aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-07-10 13:49:04 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-07-10 13:49:04 +0000
commit329b43c490f3fa2573f65f3b1a7e717d4f1a43c3 (patch)
tree905bc39dedaf52f61f33071d8fab62b1fc354018
parentcfd2c77310af7174d7f831cffe8bc3983b320788 (diff)
downloadbinutils-329b43c490f3fa2573f65f3b1a7e717d4f1a43c3.zip
binutils-329b43c490f3fa2573f65f3b1a7e717d4f1a43c3.tar.gz
binutils-329b43c490f3fa2573f65f3b1a7e717d4f1a43c3.tar.bz2
2007-07-10 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.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/simple.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 104e425..267213e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-10 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.
+
2007-07-10 Nathan Sidwell <nathan@codesourcery.com>
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't eliminate
diff --git a/bfd/simple.c b/bfd/simple.c
index 4524868..1b92a05 100644
--- a/bfd/simple.c
+++ b/bfd/simple.c
@@ -162,7 +162,10 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
int storage_needed;
void *saved_offsets;
- if (! (sec->flags & SEC_RELOC))
+ /* Don't apply relocation on executable and shared library. See
+ PR 4756. */
+ 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;