From 329b43c490f3fa2573f65f3b1a7e717d4f1a43c3 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 10 Jul 2007 13:49:04 +0000 Subject: 2007-07-10 H.J. Lu PR binutils/4756 * simple.c (bfd_simple_get_relocated_section_content): Don't apply relocation on executable and shared library. --- bfd/simple.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bfd/simple.c') 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; -- cgit v1.1