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: PR binutils/4756: addr2line fails on relocatable linux kernel


bfd_simple_get_relocated_section_content shouldn't apply relocations
on executable and shared library with relocations. This patch uses
the same check in binutils/objdump.c.


H.J.
---
2007-07-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/4756
	* simple.c (bfd_simple_get_relocated_section_content): Don't
	apply relocation on executable and shared library.

--- bfd/simple.c.reloc	2007-07-03 10:51:13.000000000 -0700
+++ bfd/simple.c	2007-07-09 11:28:26.000000000 -0700
@@ -162,7 +162,8 @@ bfd_simple_get_relocated_section_content
   int storage_needed;
   void *saved_offsets;
 
-  if (! (sec->flags & SEC_RELOC))
+  if ((abfd->flags & (HAS_RELOC | EXEC_P | DYNAMIC)) != HAS_RELOC
+      || ! (sec->flags & SEC_RELOC))
     {
       bfd_size_type amt = sec->rawsize > sec->size ? sec->rawsize : sec->size;
       bfd_size_type size = sec->rawsize ? sec->rawsize : sec->size;


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