diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-01-15 12:52:15 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2002-01-15 12:52:15 +0000 |
commit | d3c456e9506b08668419af641c7b14be84ec73ac (patch) | |
tree | b952ee6248ac6bb1f2cbde9d72ef7ea589137a8c /bfd/elf.c | |
parent | 8b8c5dbda54c48219d5e6dbba8ff9ab3594689c1 (diff) | |
download | gdb-d3c456e9506b08668419af641c7b14be84ec73ac.zip gdb-d3c456e9506b08668419af641c7b14be84ec73ac.tar.gz gdb-d3c456e9506b08668419af641c7b14be84ec73ac.tar.bz2 |
* elflink.h (elf_link_input_bfd): Back out 2002-01-07 change.
* elf.c (merge_sections_remove_hook): New function.
(_bfd_elf_merge_sections): Pass it as 3rd argument to
_bfd_merge_sections.
* libbfd-in.h (_bfd_merge_sections): Add 3rd argument.
* libbfd.h: Rebuilt.
* merge.c (_bfd_merge_sections): Add remove_hook argument.
Call remove_hook if a SEC_EXCLUDE section is encountered.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -53,6 +53,7 @@ static boolean swap_out_syms PARAMS ((bfd *, struct bfd_strtab_hash **, int)); static boolean copy_private_bfd_data PARAMS ((bfd *, bfd *)); static char *elf_read PARAMS ((bfd *, file_ptr, bfd_size_type)); static boolean setup_group PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); +static void merge_sections_remove_hook PARAMS ((bfd *, asection *)); static void elf_fake_sections PARAMS ((bfd *, asection *, PTR)); static void set_group_contents PARAMS ((bfd *, asection *, PTR)); static boolean assign_section_numbers PARAMS ((bfd *)); @@ -770,6 +771,20 @@ bfd_elf_generic_reloc (abfd, return bfd_reloc_continue; } +/* Make sure sec_info_type is cleared if sec_info is cleared too. */ + +static void +merge_sections_remove_hook (abfd, sec) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; +{ + struct bfd_elf_section_data *sec_data; + + sec_data = elf_section_data (sec); + BFD_ASSERT (sec_data->sec_info_type == ELF_INFO_TYPE_MERGE); + sec_data->sec_info_type = ELF_INFO_TYPE_NONE; +} + /* Finish SHF_MERGE section merging. */ boolean @@ -780,7 +795,8 @@ _bfd_elf_merge_sections (abfd, info) if (!is_elf_hash_table (info)) return false; if (elf_hash_table (info)->merge_info) - _bfd_merge_sections (abfd, elf_hash_table (info)->merge_info); + _bfd_merge_sections (abfd, elf_hash_table (info)->merge_info, + merge_sections_remove_hook); return true; } |