diff options
author | Daniel Jacobowitz <drow@false.org> | 2001-11-15 01:34:12 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2001-11-15 01:34:12 +0000 |
commit | 73d074b4e2c7e9a3954d0b08f048ebccd6c3e671 (patch) | |
tree | 8f33443a6ab464d2a979bf59dd24a98c71a9ba9b /ld | |
parent | 86651999acf60eb76a233cc1445fe978885f2006 (diff) | |
download | gdb-73d074b4e2c7e9a3954d0b08f048ebccd6c3e671.zip gdb-73d074b4e2c7e9a3954d0b08f048ebccd6c3e671.tar.gz gdb-73d074b4e2c7e9a3954d0b08f048ebccd6c3e671.tar.bz2 |
2001-11-11 Daniel Jacobowitz <drow@mvista.com>
* bfd-in.h (bfd_elf32_discard_info): Add prototype.
(bfd_elf64_discard_info): Likewise.
* bfd-in2.h: Regenerate.
* elf-bfd.h (struct elf_reloc_cookie): New.
(struct elf_backend_data): Add elf_backend_discard_info,
elf_backend_ignore_discarded_relocs, and elf_backend_write_section.
(_bfd_elf32_reloc_symbol_deleted_p): Add prototype.
(_bfd_elf64_reloc_symbol_deleted_p): Likewise.
* elf32-mips.c (_bfd_elf32_mips_discard_info): New.
(_bfd_elf32_mips_ignore_discarded_relocs): New.
(_bfd_elf32_mips_write_section): New.
(elf_backend_discard_info): Define.
(elf_backend_ignore_discarded_relocs): Define.
(elf_backend_write_section): Define.
* elfcode.h (elf_bfd_discard_info): Define.
(elf_reloc_symbol_deleted_p): Define.
* elflink.h (elf_link_input_bfd): Check
elf_section_ignore_discarded_relocs. Call
bed->elf_backend_write_section if available.
(elf_reloc_symbol_deleted_p): New.
(elf_bfd_discard_info): New.
(elf_section_ignore_discarded_relocs): New.
* elfxx-target.h (elf_backend_discard_info): Define.
(elf_backend_ignore_discarded_relocs): Define.
(elf_backend_write_section): Define.
(elfNN_bed): Add elf_backend_discard_info,
elf_backend_ignore_discarded_relocs, and
elf_backend_write_section.
* libbfd-in.h (_bfd_discard_section_stabs): Add prototype.
* libbfd.h: Regenerate.
* stabs.c (_bfd_discard_section_stabs): New.
2001-11-11 Daniel Jacobowitz <drow@mvista.com>
* emultempl/elf32.em (gld${EMULATION_NAME}_finish): New.
(struct ld_emulation_xfer_struct): Use it.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/emultempl/elf32.em | 23 |
2 files changed, 27 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index bbe8a08..04c57ba 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2001-11-14 Daniel Jacobowitz <drow@mvista.com> + + * emultempl/elf32.em (gld${EMULATION_NAME}_finish): New. + (struct ld_emulation_xfer_struct): Use it. + Tue Nov 13 11:27:14 2001 Ross Alexander <ross.alexander@uk.neceur.com> * emulparams/elf64hppa.sh (OTHER_BSS_END_SECTIONS): Add diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 7643380..27c2954 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -80,6 +80,8 @@ static asection *output_prev_sec_find PARAMS ((lang_output_section_statement_type *)); static boolean gld${EMULATION_NAME}_place_orphan PARAMS ((lang_input_statement_type *, asection *)); +static void gld${EMULATION_NAME}_finish + PARAMS ((void)); static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile)); @@ -1319,6 +1321,25 @@ gld${EMULATION_NAME}_place_orphan (file, s) return true; } +static void +gld${EMULATION_NAME}_finish () +{ + ${LDEMUL_FINISH+${LDEMUL_FINISH} ();} + + if (bfd_elf${ELFSIZE}_discard_info (&link_info)) + { + /* Resize the sections. */ + lang_size_sections (stat_ptr->head, abs_output_section, + &stat_ptr->head, 0, (bfd_vma) 0, false); + + /* Redo special stuff. */ + ldemul_after_allocation (); + + /* Do the assignments again. */ + lang_do_assignments (stat_ptr->head, abs_output_section, + (fill_type) 0, (bfd_vma) 0); + } +} EOF fi @@ -1618,7 +1639,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = ${LDEMUL_GET_SCRIPT-gld${EMULATION_NAME}_get_script}, "${EMULATION_NAME}", "${OUTPUT_FORMAT}", - ${LDEMUL_FINISH-NULL}, + gld${EMULATION_NAME}_finish, ${LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS-NULL}, ${LDEMUL_OPEN_DYNAMIC_ARCHIVE-gld${EMULATION_NAME}_open_dynamic_archive}, ${LDEMUL_PLACE_ORPHAN-gld${EMULATION_NAME}_place_orphan}, |