summaryrefslogtreecommitdiff
path: root/bfd/elf64-mmix.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2005-08-17 13:29:55 +0000
committerAlan Modra <amodra@bigpond.net.au>2005-08-17 13:29:55 +0000
commitc755ce0fc2166c78da8bb86e729b83cbb85a70e7 (patch)
tree234582e872fe6467b0252bdbf864f5058582f856 /bfd/elf64-mmix.c
parent880a9b4d5f4cb6c40df6282d011191f9605c14e5 (diff)
downloadbinutils-redhat-c755ce0fc2166c78da8bb86e729b83cbb85a70e7.tar.gz
* elf64-mmix.c (mmix_elf_add_symbol_hook): Mark reg section
SEC_LINKER_CREATED. (mmix_elf_final_link): Check that section hasn't already been removed before removing. * mmo.c (mmo_scan): Mark reg contents section SEC_LINKER_CREATED. (mmo_canonicalize_symtab): Likewise for reg section.
Diffstat (limited to 'bfd/elf64-mmix.c')
-rw-r--r--bfd/elf64-mmix.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index 84db270200..6f88fe102f 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -2184,7 +2184,10 @@ mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
bfd_vma *valp ATTRIBUTE_UNUSED;
{
if (sym->st_shndx == SHN_REGISTER)
- *secp = bfd_make_section_old_way (abfd, MMIX_REG_SECTION_NAME);
+ {
+ *secp = bfd_make_section_old_way (abfd, MMIX_REG_SECTION_NAME);
+ (*secp)->flags |= SEC_LINKER_CREATED;
+ }
else if ((*namep)[0] == '_' && (*namep)[1] == '_' && (*namep)[2] == '.'
&& strncmp (*namep, MMIX_LOC_SECTION_START_SYMBOL_PREFIX,
strlen (MMIX_LOC_SECTION_START_SYMBOL_PREFIX)) == 0)
@@ -2261,9 +2264,12 @@ mmix_elf_final_link (abfd, info)
if (bfd_get_section_flags (abfd, reg_section) & SEC_HAS_CONTENTS)
_bfd_abort (__FILE__, __LINE__, _("Register section has contents\n"));
- /* Really remove the section. */
- bfd_section_list_remove (abfd, reg_section);
- --abfd->section_count;
+ /* Really remove the section, if it hasn't already been done. */
+ if (!bfd_section_removed_from_list (abfd, reg_section))
+ {
+ bfd_section_list_remove (abfd, reg_section);
+ --abfd->section_count;
+ }
}
if (! bfd_elf_final_link (abfd, info))