diff options
author | Alan Modra <amodra@bigpond.net.au> | 2012-03-25 06:45:15 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2012-03-25 06:45:15 +0000 |
commit | bda24b473b98b96bf9b64f24b6f23fb96756bf70 (patch) | |
tree | 112179d3c9f2a4aa9bb81113d8971ca72471f1ba | |
parent | 391a8ed98323d2d7655a338016c745d3ba7ef959 (diff) | |
download | binutils-redhat-bda24b473b98b96bf9b64f24b6f23fb96756bf70.tar.gz |
ld/
* ldemul.c (before_allocation_default): Revert last change.
ldlang.c (lang_add_section): Likewise.
(strip_excluded_output_sections): Don't strip output sections with
user input sections when emitrelocations, unless all are SEC_EXCLUDE.
ld/testsuite/
* ld-powerpc/vxworks-relax.rd: Remove check on reloc section
file offset and reloc symbol indices.
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/ldemul.c | 2 | ||||
-rw-r--r-- | ld/ldlang.c | 6 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/vxworks-relax.rd | 14 |
5 files changed, 23 insertions, 11 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 4b9d324ecd..f3b80950af 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2012-03-25 Alan Modra <amodra@gmail.com> + + * ldemul.c (before_allocation_default): Revert last change. + ldlang.c (lang_add_section): Likewise. + (strip_excluded_output_sections): Don't strip output sections with + user input sections when emitrelocations, unless all are SEC_EXCLUDE. + 2012-03-23 Alan Modra <amodra@gmail.com> * ldemul.c (before_allocation_default): When emitrelocations, diff --git a/ld/ldemul.c b/ld/ldemul.c index 5e2fd82a0d..85baeab325 100644 --- a/ld/ldemul.c +++ b/ld/ldemul.c @@ -237,7 +237,7 @@ after_allocation_default (void) void before_allocation_default (void) { - if (!link_info.relocatable && !link_info.emitrelocations) + if (!link_info.relocatable) strip_excluded_output_sections (); } diff --git a/ld/ldlang.c b/ld/ldlang.c index 73e0179b01..b0c23cb449 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -2380,7 +2380,6 @@ lang_add_section (lang_statement_list_type *ptr, section->output_section = output->bfd_section; if (!link_info.relocatable - && !link_info.emitrelocations && !stripped_excluded_sections) { asection *s = output->bfd_section->map_tail.s; @@ -3887,8 +3886,9 @@ strip_excluded_output_sections (void) asection *s; for (s = output_section->map_head.s; s != NULL; s = s->map_head.s) - if ((s->flags & SEC_LINKER_CREATED) != 0 - && (s->flags & SEC_EXCLUDE) == 0) + if ((s->flags & SEC_EXCLUDE) == 0 + && ((s->flags & SEC_LINKER_CREATED) != 0 + || link_info.emitrelocations)) { exclude = FALSE; break; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 42c04ffa13..dc8643beec 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-03-25 Alan Modra <amodra@gmail.com> + + * ld-powerpc/vxworks-relax.rd: Remove check on reloc section + file offset and reloc symbol indices. + 2012-03-21 Hans-Peter Nilsson <hp@axis.com> PR ld/13813 diff --git a/ld/testsuite/ld-powerpc/vxworks-relax.rd b/ld/testsuite/ld-powerpc/vxworks-relax.rd index e28094c0c1..572c74ddf4 100644 --- a/ld/testsuite/ld-powerpc/vxworks-relax.rd +++ b/ld/testsuite/ld-powerpc/vxworks-relax.rd @@ -1,9 +1,9 @@ -Relocation section '.rela.text' at offset 0x4010150 contains 6 entries: +Relocation section '.rela.text' at offset .* contains 6 entries: Offset Info Type Sym.Value Sym. Name \+ Addend -00080012 00000106 R_PPC_ADDR16_HA 00080000 .text \+ 4000020 -00080016 00000104 R_PPC_ADDR16_LO 00080000 .text \+ 4000020 -00080006 00000106 R_PPC_ADDR16_HA 00080000 .text \+ 4000020 -0008000a 00000104 R_PPC_ADDR16_LO 00080000 .text \+ 4000020 -0408002a 00000306 R_PPC_ADDR16_HA 00080000 _start \+ 0 -0408002e 00000304 R_PPC_ADDR16_LO 00080000 _start \+ 0 +00080012 .* R_PPC_ADDR16_HA 00080000 .text \+ 4000020 +00080016 .* R_PPC_ADDR16_LO 00080000 .text \+ 4000020 +00080006 .* R_PPC_ADDR16_HA 00080000 .text \+ 4000020 +0008000a .* R_PPC_ADDR16_LO 00080000 .text \+ 4000020 +0408002a .* R_PPC_ADDR16_HA 00080000 _start \+ 0 +0408002e .* R_PPC_ADDR16_LO 00080000 _start \+ 0 |