summaryrefslogtreecommitdiff
path: root/ld/emultempl/genelf.em
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2010-02-19 01:47:13 +0000
committerAlan Modra <amodra@bigpond.net.au>2010-02-19 01:47:13 +0000
commita37671093643f1d923ab97ff25ef6c97fda41286 (patch)
treed1b5fcd1a58b54d24496bd2c7d122dd907e12738 /ld/emultempl/genelf.em
parenta4a91e4b48ed9055ca9f127893c6ac9b2c939e0a (diff)
downloadbinutils-redhat-a37671093643f1d923ab97ff25ef6c97fda41286.tar.gz
bfd/
* elf.c (_bfd_elf_fixup_group_sections): New function, split out from.. (_bfd_elf_copy_private_header_data): ..here. * elflink.c (_bfd_elf_size_group_sections): New function. (bfd_elf_size_dynamic_sections): Call it. * elf-bfd.h (_bfd_elf_size_group_sections): Declare. (_bfd_elf_fixup_group_sections): Declare. ld/ * ldlang.c (unique_section_p): Add os param. Allow group sections to match /DISCARD/. Update all callers. * emultempl/genelf.em (gld${EMULATION_NAME}_before_allocation): New. (LDEMUL_BEFORE_ALLOCATION): Define. ld/testsuite/ * ld-elf/group.ld: Discard .dropme sections. * ld-elf/group10.d, * ld-elf/group10.s: New test.
Diffstat (limited to 'ld/emultempl/genelf.em')
-rw-r--r--ld/emultempl/genelf.em10
1 files changed, 10 insertions, 0 deletions
diff --git a/ld/emultempl/genelf.em b/ld/emultempl/genelf.em
index 1a6c539b43..62af4de8f8 100644
--- a/ld/emultempl/genelf.em
+++ b/ld/emultempl/genelf.em
@@ -48,6 +48,15 @@ gld${EMULATION_NAME}_after_open (void)
}
static void
+gld${EMULATION_NAME}_before_allocation (void)
+{
+ if (link_info.relocatable
+ && !_bfd_elf_size_group_sections (&link_info))
+ einfo ("%X%P: can not size group sections: %E\n");
+ before_allocation_default ();
+}
+
+static void
gld${EMULATION_NAME}_after_allocation (void)
{
gld${EMULATION_NAME}_map_segments (FALSE);
@@ -56,4 +65,5 @@ EOF
# Put these extra routines in ld_${EMULATION_NAME}_emulation
#
LDEMUL_AFTER_OPEN=gld${EMULATION_NAME}_after_open
+LDEMUL_BEFORE_ALLOCATION=gld${EMULATION_NAME}_before_allocation
LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation