diff options
author | Alan Modra <amodra@gmail.com> | 2002-05-15 00:18:58 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-05-15 00:18:58 +0000 |
commit | 2d653fc7608af5956303017a1ae8303e96784a59 (patch) | |
tree | 62c029114a51741afa834d4c3fa96155e28c667f /bfd/elflink.h | |
parent | 0e0cbfbfde8653dcb082457afe80ed50d4bef95b (diff) | |
download | gdb-2d653fc7608af5956303017a1ae8303e96784a59.zip gdb-2d653fc7608af5956303017a1ae8303e96784a59.tar.gz gdb-2d653fc7608af5956303017a1ae8303e96784a59.tar.bz2 |
Fix ld --just-symbols
* aix5ppc-core.c: Warning fixes.
* aout-adobe.c (aout_32_bfd_link_just_syms): Define.
* aout-target.h (MY_bfd_link_just_syms): Define.
* aout-tic30.c (MY_bfd_link_just_syms): Define.
* bfd.c (bfd_link_just_syms): Define.
* binary.c (binary_bfd_link_just_syms): Define.
* bout.c (b_out_bfd_link_just_syms): Define.
* coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer.
* coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
* coffcode.h (coff_bfd_link_just_syms): Define.
* elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS.
(elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS.
(_bfd_elf_link_just_syms): Declare.
* elf.c (_bfd_elf_link_just_syms): New function.
* elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that
sections haven't already been discarded by the linker.
* elflink.h (elf_link_add_object_symbols): Likewise for stab
sections and SEC_MERGE sections.
(elf_bfd_discard_info): Similarly here.
* elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define.
* i386msdos.c (msdos_bfd_link_just_syms): Define.
* i386os9k.c (os9k_bfd_link_just_syms): Define.
* ieee.c (ieee_bfd_link_just_syms): Define.
* ihex.c (ihex_bfd_link_just_syms): Define.
* libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define.
(_bfd_generic_link_just_syms): Declare.
* libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define.
* linker.c (_bfd_generic_link_just_syms): New function.
* mmo.c (mmo_bfd_link_just_syms): Define.
* nlm-target.h (nlm_bfd_link_just_syms): Define.
* oasys.c (oasys_bfd_link_just_syms): Define.
* ppcboot.c (ppcboot_bfd_link_just_syms): Define.
* som.c (som_bfd_link_just_syms): Define.
* srec.c (srec_bfd_link_just_syms): Define.
* targets.c (struct bfd_target): Add _bfd_link_just_syms.
(BFD_JUMP_TABLE_LINK): And here.
* tekhex.c (tekhex_bfd_link_just_syms): Define.
* versados.c (versados_bfd_link_just_syms): Define.
* vms.c (vms_bfd_link_just_syms): Define.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index bfe6374..5a818bb 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -2258,7 +2258,9 @@ elf_link_add_object_symbols (abfd, info) asection *stab, *stabstr; stab = bfd_get_section_by_name (abfd, ".stab"); - if (stab != NULL && !(stab->flags & SEC_MERGE)) + if (stab != NULL + && (stab->flags & SEC_MERGE) == 0 + && !bfd_is_abs_section (stab->output_section)) { stabstr = bfd_get_section_by_name (abfd, ".stabstr"); @@ -2284,7 +2286,8 @@ elf_link_add_object_symbols (abfd, info) asection *s; for (s = abfd->sections; s != NULL; s = s->next) - if (s->flags & SEC_MERGE) + if ((s->flags & SEC_MERGE) != 0 + && !bfd_is_abs_section (s->output_section)) { struct bfd_elf_section_data *secdata; @@ -8267,11 +8270,19 @@ elf_bfd_discard_info (output_bfd, info) if (ehdr) { eh = bfd_get_section_by_name (abfd, ".eh_frame"); - if (eh && eh->_raw_size == 0) + if (eh && (eh->_raw_size == 0 + || bfd_is_abs_section (eh->output_section))) eh = NULL; } - stab = strip ? NULL : bfd_get_section_by_name (abfd, ".stab"); + stab = NULL; + if (!strip) + { + stab = bfd_get_section_by_name (abfd, ".stab"); + if (stab && (stab->_raw_size == 0 + || bfd_is_abs_section (stab->output_section))) + stab = NULL; + } if ((! stab || elf_section_data(stab)->sec_info_type != ELF_INFO_TYPE_STABS) && ! eh |