aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl
AgeCommit message (Collapse)AuthorFilesLines
2003-06-032003-06-03 Michael Snyder <msnyder@redhat.com>Michael Snyder1-0/+97
and Bernd Schmidt <bernds@redhat.com> and Alexandre Oliva <aoliva@redhat.com> * Makefile.am: Add new emulations for h8300sx. * Makefile.in: Regenerate. * configure.tgt: Add new emulations. * emulparams/h8300sx.sh: New emulation. * emulparams/h8300sxelf.sh: Ditto. * scripttempl/h8300sx.sc: Ditto.
2003-05-30bfd/Jakub Jelinek1-1/+2
* elflink.h (elf_link_add_object_symbols): Use !info->executable instead of info->shared where appropriate. (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. (_bfd_elf_link_create_dynamic_sections): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section and DT_DEBUG dynamic tag even for position independent executables. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. include/ * bfdlink.h (struct bfd_link_info): Add pie and executable bits. ld/ * lexsup.c (OPTION_PIE): Define. (ld_options): Add -pie and --pic-executable options. (parse_args): Handle OPTION_PIE. * ldmain.c (main): Initialize link_info.pie and link_info.executable. * genscripts.sh: Generate PIE scripts. * ld.texinfo: Document -pie and --pic-executable options. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): (gld${EMULATION_NAME}_place_orphan): Likewise. (gld${EMULATION_NAME}_get_script): Include PIE scripts. * scripttempl/elf.sc: In PIE scripts set . the same way as in shared scripts. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Set to yes. * emulparams/elf64_ia64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_x86_64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64alpha.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Likewise.
2003-04-24oops - omitted from previous deltaNick Clifton2-0/+174
2003-04-24Add support for h8300hn and h8300snNick Clifton1-0/+7
2003-04-18Define __data and __rdataNick Clifton1-0/+2
2003-04-16 Add .jcr section mapping.Nick Clifton1-0/+1
2003-04-14 * scripttempl/elf.sc (CTOR): Handle crtbeginS.o, crtendS.o andAlan Modra9-36/+36
other variants of crtbegin.o, crtend.o. (DTOR): Likewise. * scripttempl/crisaout.sc (ctors, dtors): Likewise. * scripttempl/elf_chaos.sc (CTOR, DTOR): Likewise. * scripttempl/elfd10v.sc (CTOR, DTOR): Likewise. * scripttempl/elfd30v.sc (CTOR, DTOR): Likewise. * scripttempl/elfxtensa.sc (CTOR, DTOR): Likewise. * scripttempl/iq2000.sc (CTOR, DTOR): Likewise. * scripttempl/mmo.sc (ctors, dtors): Likewise. * scripttempl/xstormy16.sc (CTOR, DTOR): Likewise.
2003-04-09Add initX, finiX, ctors, dtors sections to respect C++ constructor/destructor.Nick Clifton2-0/+62
Add ctors/dtors start/stop definitions.
2003-04-04Namespace cleanup for the tic4x target. Replace s/c4x/tic4x/ and ↵Svein Seldal1-2/+2
s/c3x/tic3x/. 2003 copyright update
2003-04-01Add Xtensa portNick Clifton1-0/+397
2003-03-25Add iWMMXt supportNick Clifton1-2/+2
2003-03-03* scripttempl/pe.sc: Use PROVIDE with etext, end, _end,Christopher Faylor1-3/+3
2003-02-11Add new data anchors defenitions.Nick Clifton2-0/+8
2003-01-20Updates for fixing tic4x arch tagging of its object files.Svein Seldal2-149/+116
* bfd/coffcode.h (coff_set_flags): Added get/set arch hooks. * include/coff/tic4x.h (TICOFF_TARGET_MACHINE_GET): Fixed define bug * include/coff/ti.h (TICOFF_TARGET_MACHINE_GET): Added macros * ld/Makefile.am: Added etic3xcoff.o and etic4xcoff_onchip.o * ld/Makefile.in: Regenerate * ld/configure.tgt: Added extra target emulations * ld/emulparams/tic3xcoff.sh: Remove old settings * ld/emulparams/tic4xcoff.sh: Ditto * ld/emulparams/tic3xcoff-onchip.sh: Added new * ld/scripttempl/tic4xcoff.sc: Revise and combine both c3x and c4x * ld/scripttempl/tic3xcoff.sc: Remove
2003-01-04 * Makefile.am (ALL_EMULATIONS): Add eelf32iq2000.o.Stan Cox1-0/+443
(eelf32iq2000.c): New target. * Makefile.in: Regenerate. * configure.tgt: Handle iq2000-*-elf. * emulparams/elf32iq10.sh: New file. * emulparams/elf32iq2000.sh: New file. * scripttempl/iq2000.sc: New file.
2002-12-30Add support for msp430.Nick Clifton2-0/+345
2002-10-23(__RUNTIME_PSEUDO_RELOC_LIST__, __RUNTIME_PSEUDO_RELOC_LIST_END__): AddNick Clifton1-4/+4
only when relocating.
2002-10-13 * scripttempl/elfm68hc11.sc: Use KEEP for .vectors, .installN,Stephane Carrez2-22/+22
.finiN section. * scripttempl/elfm68hc12.sc: Likewise.
2002-09-30 * scripttempl/elfd30v.sc: Order reloc sections placing .plt last.Alan Modra3-49/+47
* scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise.
2002-09-25 From "Anita Kulkarni" <AnitaK@kpit.com>Daniel Jacobowitz1-0/+5
* scripttempl/sh.sc: Handle .eh_frame* and .gcc_exc* sections.
2002-09-25 * genscripts.sh (SEGMENT_SIZE): Use MAXPAGESIZE beforeAlan Modra1-2/+2
TARGET_PAGE_SIZE. * scripttempl/elf.sc (DATA_SEGMENT_ALIGN): Incorporate SEGMENT_SIZE alignment. * emulparams/elf64ppc.sh (DATA_ADDR): Delete. (SEGMENT_SIZE): Define.
2002-09-24 * emulparams/elf64ppc.sh (DATA_ADDR): Define.Alan Modra1-1/+1
* emulparams/elf64_aix.sh (DATA_ADDR): Don't use a fixed address for start of .data, instead align up to 256M boundary. * scripttempl/aix.sc: Likewise.
2002-09-23* scripttempl/i386go32.sc: Handle bss unique sections.DJ Delorie1-1/+1
2002-09-02Add EXTERN references to __ctbpm __gp and __ep.Nick Clifton1-0/+1
Define TEMPLATE_NAME. Revert bogus change to ldexp.c
2002-08-30Update description to reflect D10V TS3 board.Nick Clifton1-5/+14
2002-08-28Add TMS320C4x supportNick Clifton2-0/+184
2002-08-27Handle .rdata_runtime_pseudo_reloc sections.Nick Clifton1-0/+5
2002-08-01Revert Adam Nemet's THUMB PLT patchNick Clifton1-4/+0
2002-07-31Add support for Thumb PLT entries with interworkingNick Clifton1-0/+4
2002-07-17Add IP2k support to BFD and LDNick Clifton1-0/+150
2002-06-29 * emulparams/m68hc12elfb.sh (EEPROM_MEMORY): Define.Stephane Carrez2-0/+25
* emulparams/m68hc11elfb.sh (EEPROM_MEMORY): Define. * emulparams/m68hc11elf.sh (EEPROM_SIZE): Define. (EEPROM_START_ADDR): Define. (EEPROM_MEMORY): Define. * emulparams/m68hc12elf.sh: Likewise. * scripttempl/elfm68hc11.sc: Handle .eeprom section; handle .softregs section to put soft registers in .page0. * scripttempl/elfm68hc12.sc: Likewise but put soft registers in bss.
2002-06-17Fix ld segfault for some elf targets. Fix default layout for d10v.Tom Rix1-3/+3
2002-06-07 * scripttempl/elf.sc (.tbss): Fix mismatched parentheses/braces.Alan Modra1-1/+1
2002-06-01 * scripttempl/avr.sc: Changes to support current GCC and avr-libc,Marek Michalkiewicz1-4/+44
C++ constructors/destructors, loosely based on the m68hc11 port.
2002-05-28Add DLX targetNick Clifton1-0/+30
2002-05-27Install new elf_chaos.sc script.Nick Clifton1-0/+354
2002-05-23 * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCALJakub Jelinek1-0/+8
for symbols from SHF_TLS section. (_bfd_elf_print_private_bfd_data): Add PT_TLS. (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections. (map_sections_to_segments): Build PT_TLS segment if necessary. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Account for PT_TLS segment. (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from SEC_THREAD_LOCAL sections to STT_TLS. * reloc.c: Add 386 and IA-64 TLS relocs. * section.c (SEC_THREAD_LOCAL): Define. (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS): Remove. * elflink.h (elf_link_add_object_symbols): Support .tcommon. (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS unconditionally. (struct elf_final_link_info): Add first_tls_sec. (elf_bfd_final_link): Set first_tls_sec. Compute elf_hash_table (info)->tls_segment. (elf_link_output_extsym): Handle STT_TLS symbols. (elf_link_input_bfd): Likewise. * syms.c (BSF_THREAD_LOCAL): Define. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff, elf_i386_mkobject, elf_i386_object_p): New functions. (elf_howto_table): Add TLS relocs. (elf_i386_reloc_type_lookup): Support TLS relocs. (elf_i386_info_to_howto_rel): Likewise. (struct elf_i386_link_hash_entry): Add tls_type. (struct elf_i386_obj_tdata): New. (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type): New macros. (struct elf_i386_link_hash_table): Add tls_ldm_got. (link_hash_newfunc): Clear tls_type. (elf_i386_check_relocs): Support TLS relocs. (elf_i386_gc_sweep_hook): Likewise. (allocate_dynrelocs): Likewise. (elf_i386_size_dynamic_sections): Likewise. (elf_i386_relocate_section): Likewise. (elf_i386_finish_dynamic_symbol): Likewise. (bfd_elf32_mkobject, elf_backend_object_p): Define. * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset, dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done, want_tprel, want_dtpmod, want_dtprel. (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions. (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to R_IA64_LTOFF_TPREL22. (elf_code_to_howto_index): Add TLS relocs. (elfNN_ia64_check_relocs): Support TLS relocs. (allocate_global_data_got): Account for TLS .got data. (allocate_dynrel_entries): Account for TLS dynamic relocations. (elfNN_ia64_install_value): Supprt TLS relocs. (set_got_entry): Support TLS relocs. (elfNN_ia64_relocate_section): Likewise. * config/obj-elf.c (elf_common): Renamed from obj_elf_common. (obj_elf_common): Call elf_common. (obj_elf_tls_common): New function. (elf_pseudo_tab): Support .tls_common. (special_sections): Add .tdata and .tbss. (obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS sections. (obj_elf_parse_section_letters): Support T in section flags (SHF_TLS). (obj_elf_parse_section_letters): Include T in error message. * config/tc-ppc.c (ppc_section_letter): Likewise. * config/tc-alpha.c (alpha_elf_section_letter): Likewise. (tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as SEC_MERGE. * config/tc-sparc.c (md_apply_fix3): Likewise. * config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs. Define them if not BFD_ASSEMBLER. (lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF and @NTPOFF. (md_apply_fix3): Add TLS relocs. * config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE, FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE, FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE. (pseudo_func): Support @dtpmod(), @dtprel() and @tprel(). (ia64_elf_section_letter): Include T in error message. (md_begin): Support TLS operators. (md_operand): Likewise. (ia64_gen_real_reloc_type): Support TLS relocs. * testsuite/gas/i386/tlspic.s: New file. * testsuite/gas/i386/tlsd.s: New file. * testsuite/gas/i386/tlsnopic.s: New file. * testsuite/gas/i386/tlsd.d: New file. * testsuite/gas/i386/tlsnopic.d: New file. * testsuite/gas/i386/tlspic.d: New file. * testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests. * testsuite/gas/ia64/tls.s: New file. * testsuite/gas/ia64/tls.d: New file. * testsuite/gas/ia64/ia64.exp: Add tls test. * write.c (adjust_reloc_syms): Don't change symbols in SEC_THREAD_LOCAL sections to STT_SECTION + addend. * elf/common.h (PT_TLS, SHF_TLS, STT_TLS, DF_STATIC_TLS): Define. * elf/ia64.h (R_IA64_LTOFF_TPREL22): Renamed from R_IA64_LTOFF_TP22. * elf/i386.h: Add TLS relocs. * scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss. * ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for output section if necessary. Handle .tbss. (lang_size_sections): Clear _raw_size for .tbss section (it allocates space in PT_TLS segment only). * ldwrite.c (build_link_order): Build link order for .tbss too. * readelf.c (get_segment_type): Add PT_TLS. (get_elf_section_flags): Add SHF_TLS. (get_dynamic_flags): Optimize. Add DF_STATIC_TLS. (process_dynamic_segment): Use puts instead of printf. (get_symbol_type): Support STT_TLS. * objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS. Add SEC_THREAD_LOCAL.
2002-05-16 * emulparams/avr1.sh: New file.Marek Michalkiewicz1-0/+149
* emulparams/avr2.sh: New file. * emulparams/avr3.sh: New file. * emulparams/avr4.sh: New file. * emulparams/avr5.sh: New file. * scripttempl/avr.sc: New file.
2002-03-05 * scripttempl/elf.sc: Only use DATA_SEGMENT_END() together withJakub Jelinek1-2/+6
DATA_SEGMENT_ALIGN.
2002-03-042002-03-04 H.J. Lu <hjl@gnu.org>H.J. Lu1-17/+17
* scripttempl/elf.sc: Put .preinit_array, .init_array and .fini_array in the data segment.
2002-03-04 * scripttempl/elf.sc: Correct syntax errors in 2002-03-01 commit.Alan Modra1-2/+2
2002-03-02 * scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array,Richard Henderson1-0/+17
.init_array, and .fini_array.
2002-02-12 * ldlex.l (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens.Jakub Jelinek1-2/+7
* ldgram.y (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens. (exp): Add DATA_SEGMENT_ALIGN (exp, exp) and DATA_SEGMENT_END (exp). * ldexp.c (exp_data_seg): New variable. (exp_print_token): Handle DATA_SEGMENT_ALIGN and DATA_SEGMENT_END. (fold_binary): Handle DATA_SEGMENT_ALIGN. (exp_fold_tree): Handle DATA_SEGMENT_END. Pass allocation_done when recursing instead of hardcoding lang_allocating_phase_enum. * ldexp.h (exp_data_seg): New. * ldlang.c (lang_size_sections_1): Renamed from lang_size_sections. (lang_size_sections): New. * ld.texinfo (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): Document. * scripttempl/elf.sc: Use DATA_SEGMENT_ALIGN and DATA_SEGMENT_END if COMMONPAGESIZE is defined. * emulparams/elf_i386.sh (COMMONPAGESIZE): Set to 4K. * emulparams/elf32_sparc.sh (COMMONPAGESIZE): Set to 8K. * emulparams/elf64_sparc.sh (COMMONPAGESIZE): Set to 8K. * emulparams/elf64alpha.sh (COMMONPAGESIZE): Set to 8K. * emulparams/elf64_ia64.sh (COMMONPAGESIZE): Set to 16K for shared libraries only.
2002-02-01In ld/ChangeLog:Geoffrey Keating1-2/+1
* scripttempl/xstormy16.sc: Don't allocate extra space for the stack. In libgloss/ChangeLog: * xstormy16/Makefile.in (SIM_OBJS): Remove sbrk.o, add sim_malloc_start.o. * xstormy16/eva_app.ld: Add __malloc_start. * xstormy16/sbrk.c: Remove. * xstormy16/sim_malloc_start.s: New file. * xstormy16/sim_high.ld: Make the stack start immediately at the end of the program. In newlib/ChangeLog: * configure.host (xstormy16): Don't use the generic malloc. * libc/machine/xstormy16/Makefile.am: Build tiny-malloc. * libc/machine/xstormy16/Makefile.in: Regenerate. * libc/machine/xstormy16/mallocr.c: New file. * libc/machine/xstormy16/tiny-malloc.c: New file.
2002-02-01 Support on-demand global register allocation fromHans-Peter Nilsson1-2/+3
R_MMIX_BASE_PLUS_OFFSET relocs. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Rename from mmix_set_reg_section_vma. Call _bfd_mmix_finalize_linker_allocated_gregs. (mmix_before_allocation): New function. (LDEMUL_AFTER_ALLOCATION): Set to mmix_after_allocation. (LDEMUL_BEFORE_ALLOCATION): Define to mmix_before_allocation. * scripttempl/mmo.sc (.text): Mark .init, .fini as KEEP. (.MMIX.reg_contents): Add .MMIX.reg_contents.linker_allocated before .MMIX.reg_contents. * emultempl/mmo.em (gldmmo_before_allocation): Define to default. (mmo_after_open): New function. (LDEMUL_AFTER_OPEN): Define to mmo_after_open. * emulparams/elf64mmix.sh (OTHER_SECTIONS): Tweak formatting. Add .MMIX.reg_contents.linker_allocated before .MMIX.reg_contents.
2002-01-31Add support for OpenRISC 32-bit embedded processorNick Clifton1-0/+37
2002-01-16* scripttempl/pe.sc: Add support for constructor priorities.DJ Delorie1-2/+2
2002-01-12 * emulparams/avr1200.sh (DATA_START): Define as 0x60.Denis Chertykov1-1/+1
* emulparams/avr23xx.sh: Likewise. * emulparams/avr4433.sh: Likewise. * emulparams/avr44x4.sh: Likewise. * emulparams/avr85xx.sh: Likewise. * emulparams/avrmega103.sh: Likewise. * emulparams/avrmega161.sh: Likewise. * emulparams/avrmega603.sh: Likewise. * scripttempl/elf32avr.sc: Use DATA_START instead of 0x60.
2001-12-16 * scripttempl/mmo.sc: Add .debug_ranges to listed sections.Hans-Peter Nilsson1-0/+1
2001-12-13 * elf-bfd.h (enum elf_link_info_type): New.Jakub Jelinek1-0/+1
(struct bfd_elf_section_data): Remove stab_info and merge_info fields, add sec_info and sec_info_type. (struct elf_obj_tdata): Add eh_frame_hdr field. (_bfd_elf_discard_section_eh_frame): New prototype. (_bfd_elf_discard_section_eh_frame_hdr): Likewise. (_bfd_elf_eh_frame_section_offset): Likewise. (_bfd_elf_write_section_eh_frame): Likewise. (_bfd_elf_write_section_eh_frame_hdr): Likewise. * Makefile.am (BFD32_BACKENDS): Add elf-eh-frame.lo. (BFD32_BACKENDS_CFILES): Add elf-eh-frame.c. (elf-eh-frame.lo): New. * Makefile.in: Rebuilt. * configure.in (elf): Add elf-eh-frame.lo. * configure: Rebuilt. * elf.c (_bfd_elf_print_private_bfd_data): Support PT_GNU_EH_FRAME. (map_sections_to_segments): Create PT_GNU_EH_FRAME if requested. (get_program_header_size): Take into account PT_GNU_EH_FRAME segment. (_bfd_elf_rela_local_sym): Use sec_info_type and sec_info. (_bfd_elf_rel_local_sym): Likewise. (_bfd_elf_section_offset): Likewise. Call _bfd_elf_eh_frame_section_offset too. * elfxx-ia64.c (elfNN_ia64_relocate_section): Use sec_info_type and sec_info. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elf-eh-frame.c: New file. * elflink.h (elf_link_add_object_symbols): Don't optimize SHF_MERGE .stab sections. Set sec_info_type, use sec_info instead of merge_info and stab_info. (elf_link_create_dynamic_sections): Create .eh_frame_hdr section if --eh-frame-hdr. (elf_bfd_final_link): Write .eh_frame_hdr section. (elf_link_sec_merge_syms): Use sec_info_type and sec_info. (elf_link_input_bfd): Likewise. Call _bfd_elf_write_section_eh_frame to write .eh_frame sections. (elf_bfd_discard_info): Add output_bfd argument. Call _bfd_elf_discard_section_eh_frame and _bfd_elf_discard_section_eh_frame_hdr. (elf_section_ignore_discarded_relocs): Use sec_info_type, not section names. * bfd-in.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Adjust prototypes. * bfd-in2.h (bfd_elf32_discard_info, bfd_elf64_discard_info): Likewise. * elf/common.h (PT_GNU_EH_FRAME): Define. * bfdlink.h (struct bfd_link_info): Add eh_frame_hdr field. * emultempl/elf32.em (finish): Supply output_bfd to bfd_elf*_discard_info. (OPTION_EH_FRAME_HDR): Define. (longopts): Add --eh-frame-hdr. (parse_args): Handle it. (list_options): Add --eh-frame-hdr to help. * emultempl/hppaelf.em (finish): Supply output_bfd to bfd_elf*_discard_info. * scripttempl/elf.sc (.eh_frame_hdr): Add. * readelf.c (get_segment_type): Support PT_GNU_EH_FRAME.