This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: binutils/3609: `objcopy --only-keep-debug` segfaults in current cvs


The fix is wrong. We want to preserve segment physical address in the
output segment if the first section in the corresponding input segment
is null.


H.J.
----
2006-12-01  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/3609
	* elf.c (rewrite_elf_program_header): Preserve segment physical
	address in the output segment if the first section in the
	corresponding input segment is null.

--- bfd/elf.c.null	2006-12-01 07:46:56.000000000 -0800
+++ bfd/elf.c	2006-12-01 07:47:50.000000000 -0800
@@ -5472,7 +5472,7 @@ rewrite_elf_program_header (bfd *ibfd, b
       /* If the first section in the input segment is removed, there is
 	 no need to preserve segment physical address in the corresponding
 	 output segment.  */
-      if (first_section != NULL && first_section->output_section != NULL)
+      if (!first_section || first_section->output_section != NULL)
 	{
 	  map->p_paddr = segment->p_paddr;
 	  map->p_paddr_valid = 1;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]