diff options
author | Alan Modra <amodra@gmail.com> | 2001-09-29 12:07:01 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2001-09-29 12:07:01 +0000 |
commit | 862517b6506a76ce9dc0e06b8f1d98577371e3b4 (patch) | |
tree | cb956a05e4995c05b5dec75e0eb63df3d1510f37 /bfd/elflink.h | |
parent | 65f38f15bf0d85cf1b7d142f76278a668652b4b7 (diff) | |
download | gdb-862517b6506a76ce9dc0e06b8f1d98577371e3b4.zip gdb-862517b6506a76ce9dc0e06b8f1d98577371e3b4.tar.gz gdb-862517b6506a76ce9dc0e06b8f1d98577371e3b4.tar.bz2 |
* section.c (struct sec): Remove kept_section.
(STD_SECTION): Remove kept_section initialisation.
(bfd_make_section_anyway): Here too.
* ecoff.c (bfd_debug_section): Remove kept_section initialisation.
* cofflink.c (_bfd_coff_link_input_bfd): Don't test kept_section.
* elflink.h (elf_link_input_bfd): Set discarded link-once section
symbols to zero, and remove all code involved with kept_section
and tracking section symbol values.
* bfd-in2.h: Regenerate.
* configure.in: Bump version number.
* configure: Regenerate.
* ldlang.c (section_already_linked): Remove assignment to kept_section.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index 73687fb..39f8811 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -5962,12 +5962,8 @@ elf_link_input_bfd (finfo, input_bfd) } } - name = NULL; if (isym->st_shndx == SHN_UNDEF) - { - isec = bfd_und_section_ptr; - name = isec->name; - } + isec = bfd_und_section_ptr; else if (isym->st_shndx > 0 && isym->st_shndx < SHN_LORESERVE) { isec = section_from_elf_index (input_bfd, isym->st_shndx); @@ -5979,15 +5975,9 @@ elf_link_input_bfd (finfo, input_bfd) isym->st_value, (bfd_vma) 0); } else if (isym->st_shndx == SHN_ABS) - { - isec = bfd_abs_section_ptr; - name = isec->name; - } + isec = bfd_abs_section_ptr; else if (isym->st_shndx == SHN_COMMON) - { - isec = bfd_com_section_ptr; - name = isec->name; - } + isec = bfd_com_section_ptr; else { /* Who knows? */ @@ -6002,39 +5992,18 @@ elf_link_input_bfd (finfo, input_bfd) if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) { - asection *ksec; - - /* Save away all section symbol values. */ - if (isec != NULL) - { - if (name) - { - if (isec->symbol->value != isym->st_value) - (*_bfd_error_handler) - (_("%s: invalid section symbol index 0x%x (%s) ignored"), - bfd_archive_filename (input_bfd), isym->st_shndx, - name); - continue; - } - isec->symbol->value = isym->st_value; - } - - /* If this is a discarded link-once section symbol, update - it's value to that of the kept section symbol. The - linker will keep the first of any matching link-once - sections, so we should have already seen it's section - symbol. I trust no-one will have the bright idea of - re-ordering the bfd list... */ + /* If this is a discarded link-once section symbol, set its + value to 0. We should really undefine it, and complain + if anything in the final link tries to use it, but + DWARF-based exception handling might have an entry in + .eh_frame to describe a routine in the linkonce section, + and it turns out to be hard to remove the .eh_frame entry + too. FIXME. */ if (isec != NULL && (bfd_get_section_flags (input_bfd, isec) & SEC_LINK_ONCE) != 0 - && (ksec = isec->kept_section) != NULL) + && bfd_is_abs_section (isec->output_section)) { - isym->st_value = ksec->symbol->value; - - /* That put the value right, but the section info is all - wrong. I hope this works. */ - isec->output_offset = ksec->output_offset; - isec->output_section = ksec->output_section; + isym->st_value = 0; } /* We never output section symbols. Instead, we use the |