bfd/
* elf32-arm.c (bfd_elf32_arm_process_before_allocation): Suppress
call veneers for call relocations against undefined symbols.
(elf32_arm_final_link_relocate): Turn call to undefined symbol
into a jump to the next instruction.
ld/testuite/
* ld-arm/arm-elf.exp (armelftests): Add callweak.
* ld-arm/callweak.d: New test.
* ld-arm/callweak.s: New test.
* elfxx-mips.c (mips_elf_calculate_relocation): Allow local stubs
to be used for calls from MIPS16 code.
gas/
* config/tc-mips.h (TC_SYMFIELD_TYPE): New.
* config/tc-mips.c (append_insn): Record which symbols have
R_MIPS16_26 relocations against them.
(mips_fix_adjustable): Don't reduce relocations against such symbols.
ld/testsuite/
* ld-mips-elf/mips16-local-stubs-1.s,
* ld-mips-elf/mips16-local-stubs-1.d: New tests.
* ld-mips-elf/mips-elf.exp: Run them.
* elf32-xtensa.c (extend_ebb_bounds_forward): Use renamed
XTENSA_PROP_NO_TRANSFORM flag instead of XTENSA_PROP_INSN_NO_TRANSFORM.
(extend_ebb_bounds_backward, compute_text_actions): Likewise.
(compute_ebb_proposed_actions, coalesce_shared_literal): Likewise.
(xtensa_get_property_predef_flags): Likewise.
(compute_removed_literals): Pass new arguments to is_removable_literal.
(is_removable_literal): Add sec, prop_table and ptblsize arguments.
Do not remove literal if the NO_TRANSFORM property flag is set.
gas/
* config/tc-xtensa.c (XTENSA_PROP_INSN_NO_TRANSFORM): Renamed to...
(XTENSA_PROP_NO_TRANSFORM): ...this.
(frag_flags_struct): Move is_no_transform out of the insn sub-struct.
(xtensa_mark_frags_for_org): New.
(xtensa_handle_align): Set RELAX_ORG frag subtype for rs_org.
(xtensa_post_relax_hook): Call xtensa_mark_frags_for_org.
(get_frag_property_flags): Adjust reference to is_no_transform flag.
(xtensa_frag_flags_combinable): Likewise.
(frag_flags_to_number): Likewise. Use XTENSA_PROP_NO_TRANSFORM.
* config/tc-xtensa.h (xtensa_relax_statesE): Add RELAX_ORG.
include/elf/
* xtensa.h (XTENSA_PROP_INSN_NO_TRANSFORM): Renamed to...
(XTENSA_PROP_NO_TRANSFORM): ...this.
ld/
* emultempl/xtensaelf.em (replace_insn_sec_with_prop_sec): Use renamed
XTENSA_PROP_NO_TRANSFORM flag instead of XTENSA_PROP_INSN_NO_TRANSFORM.
* embedspu.sh: Emit SPU ELF image to .data.rel.ro.speelf if
pic or pie and image needs relocs.
ld/
* emultempl/spuelf.em (base_name): New function, split out from..
(embedded_spu_file) ..here. Pass -fPIC or -fpie to embedspu
invocation if we deduce a shared lib or position independent
executable build by looking at ctrbegin* linker input files.
* ld-arm/vxworks1.ld: Swap .bss and .data.
* ld-arm/vxworks1-lib.rd: Update accordingly.
* ld-arm/vxworks1-lib.td: New test.
* ld-arm/arm-elf.exp: Run it.
* ld-i386/vxworks1.ld: Swap .bss and .data.
* ld-i386/vxworks1-lib.rd: Update accordingly.
* ld-i386/vxworks1-lib.td: New test.
* ld-i386/i386.exp: Run it.
* ld-mips-elf/vxworks1.ld: Swap .bss and .data.
* ld-mips-elf/vxworks1-lib.rd: Update accordingly.
* ld-mips-elf/vxworks1.rd: Likewise.
* ld-powerpc/vxworks1.ld: Swap .bss and .data.
* ld-powerpc/vxworks1-lib.rd: Update accordingly.
* ld-powerpc/vxworks1-lib.td: New test.
* ld-powerpc/powerpc.exp: Run it.
* ld-sh/vxworks1.ld: Swap .bss and .data.
* ld-sh/vxworks1-lib.rd: Update accordingly.
* ld-sh/vxworks1-lib.td: New test.
* ld-sh/sh-vxworks.exp: Run it.
* ld-sparc/vxworks1.ld: Swap .bss and .data.
* ld-sparc/vxworks1-lib.rd: Update accordingly.
* ld-sparc/vxworks1-lib.td: New test.
* ld-sparc/sparc.exp: Run it.
* elfxx-mips.c (mips_elf_create_local_got_entry): Remove
input_section argument. Create .rela.dyn relocations against
symbol 0 rather than the section symbol.
(mips_elf_local_got_index): Remove input_section argument.
Update call to mips_elf_create_local_got_entry.
(mips_elf_got_page, mips_elf_got16_entry): Likewise.
(mips_elf_calculate_relocation): Update calls to
mips_elf_local_got_index, mips_elf_got16_entry and mips_elf_got_page.
ld/testsuite/
* ld-mips-elf/vxworks1-lib.rd: Expect the GOT relocation to be
against symbol 0.
* ld-sh/vxworks1.dd: Remove hexadecimal prefixes from constant pool
contents. Consistently use "!" as the comment character.
Consistently use _PROCEDURE_LINKAGE_TABLE_ in the first PLT entry.
* ld-sh/vxworks1-le.dd: Likewise.
* ld-sh/vxworks1-lib.dd: Likewise.
* ld-sh/vxworks1-lib-le.dd: Likewise.
* ld-sh/vxworks3.dd: Likewise.
* ld-sh/vxworks3-le.dd: Likewise.
* elf32-arm.c (elf32_arm_check_relocs): Don't create PLT entries
for R_ARM_ABS12 relocs.
(elf32_arm_finish_dynamic_symbol): Fix the loop that creates
non-shared VxWorks PLT entries.
ld/testsuite/
* ld-arm/vxworks1-lib.dd: Expect "push" instead of stmdb and
"pop" instead of ldmia. Don't require specific symbolic addresses
for in-text addresses. Expect data to be rendered as .words rather
than disassembled.
* ld-arm/vxworks1.dd: Likewise.
* elf.c (assign_file_positions_for_load_sections): Use p_memsz
rather than p_filesz to calculate the LMA of the end of a segment.
ld/testsuite/
* ld-elf/multibss1.d, ld-elf/multibss1.s: New test.
to test that entry for deleted function is zeroed. Add a
somewhat closer to normal .eh_frame to test that fde for
deleted function is removed.
* ld-linkonce/y.s: Likewise.
* ld-linkonce/zeroeh.ld: Place .gcc_except_table too.
* ld-linkonce/zeroehl32.d: Update.
* ldlang.h (enum section_type): Add overlay_section.
* ldlang.c (lang_add_section): Handle flags for overlay_section
as per normal_section.
(lang_size_sections_1): When setting lma, detect overlays by
os->sectype rather than by looking for overlapping vmas.
(lang_enter_overlay_section): Use overlay_section type.
(lang_leave_overlay): Set first overlay section to normal.
ld/testsuite/
* ld-spu/ovl.lnk: Use OVERLAY keyword.
* elfxx-mips.c (mips_elf_calculate_relocation): Set DT_TEXTREL
when creating a __GOTT_BASE__ or __GOTT_INDEX__ relocation
in a read-only section.
(_bfd_mips_elf_check_relocs): Likewise.
ld/testsuite/
* ld-mips-elf/vxworks1-lib.td: New test.
* ld-mips-elf/mips-elf.exp: Run it.
2007-04-02 H.J. Lu <hongjiu.lu@intel.com>
PR ld/4090
* ldexp.h (node_type): Add lineno.
* ldexp.c: Include "ldlex.h".
(exp_intop): Set the lineno field from lineno.
(exp_bigintop): Likewise.
(exp_relop): Likewise.
(exp_nameop): Likewise.
(exp_binop): Set the lineno field from lineno of lhs.
(exp_trinop): Likewise.
(exp_unop): Set the lineno field from lineno of child.
(exp_assop): Set the lineno field from lineno of src.
(exp_provide): Likewise.
(exp_assert): Set the lineno field from lineno of exp.
(exp_get_abs_int): Set lineno from lineno of nonconstant
expression when report problem.
ld/testsuite/
2007-04-02 H.J. Lu <hongjiu.lu@intel.com>
PR ld/4090
* ld-elf/expr1.d: New file.
* ld-elf/expr1.s: Likewise.
* ld-elf/expr1.t: Likewise.
200x-xx-xx Richard Sandiford <richard@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com>
* NEWS: Mention -l:foo.
* ld.texinfo: Document it.
* ldlang.c (new_afile): If a lang_input_file_is_l_enum
entry as a name beginning with a coloh, convert it to a
lang_input_file_is_search_file_enum entry without the colon.
ld/testsuite/
* ld-libs/lib-1.s, ld-libs/lib-2.s, ld-libs/lib-2.d,
* ld-libs/libs.exp: New files.
* ld.h (ld_config_type): Add rpath_separator.
* ldmain.c (main): Initialize it.
* lexsup.c (parse_args): Honor config.rpath_separator.
* emultempl/elf32.em (gld${EMULATION_NAME}_search_needed): Likewise.
(gld${EMULATION_NAME}_add_sysroot): Likewise.
(gld${EMULATION_NAME}_parse_ld_so_conf): Use config.rpath_separator
rather than ':' when building the path.
* emultempl/vxworks.em (vxworks_before_parse): New function.
Override config.rpath_separator.
(LDEMUL_AFTER_OPEN): Do not change if EXTRA_EM_FILE has been
set to gld${EMULATION_NAME}_after_open; #define that identifier
to vxworks_foo instead.
(LDEMUL_BEFORE_PARSE): Override in the same way as LDEMUL_AFTER_OPEN.
ld/testsuite/
* ld-vxworks/rpath-1.s, ld-vxworks/rpath-1.d,
* ld-vxworks/vxworks.exp: New files.
200x-xx-xx Richard Sandiford <richard@codesourcery.com>
Phil Edwards <phil@codesourcery.com>
* doc/bfd.texinfo: Put the contents after the title page rather
than at the end of the document.
binutils/
200x-xx-xx Richard Sandiford <richard@codesourcery.com>
Phil Edwards <phil@codesourcery.com>
* doc/binutils.texi: Put the contents after the title page rather
than at the end of the document.
gas/
200x-xx-xx Richard Sandiford <richard@codesourcery.com>
Phil Edwards <phil@codesourcery.com>
* doc/as.texinfo: Put the contents after the title page rather
than at the end of the document.
gprof/
200x-xx-xx Richard Sandiford <richard@codesourcery.com>
Phil Edwards <phil@codesourcery.com>
* gprof.texi: Put the contents after the title page rather
than at the end of the document.
ld/
200x-xx-xx Richard Sandiford <richard@codesourcery.com>
Phil Edwards <phil@codesourcery.com>
* ld.texinfo: Put the contents after the title page rather
than at the end of the document.
* ldlang.c (lang_insert_orphan): Provide start/stop loadaddr syms
rather than defining unconditionally.
(lang_leave_overlay_section): Likewise.
* ld.texinfo (Overlay Description): Update description and examples
for start/stop syms.
ld/testsuite/
* ld-elf/overlay.d: -u symbols we want to see in the output.
* Makefile.am (bfdver.h): Only set VERSION_PACKAGE in bfdver.texi
if nonempty.
* configure.in (REPORT_BUGS_TO): Do not use "URL:" prefix.
* Makefile.in, configure, doc/Makefile.in: Regenerate.
binutils:
* doc/binutils.texi: Include VERSION_PACKAGE when reporting
version.
gas:
* doc/as.texinfo: Include VERSION_PACKAGE when reporting version.
gprof:
* Makefile.am (TEXI2POD): Include $(AM_MAKEINFOFLAGS).
(AM_MAKEINFOFLAGS, TEXI2DVI): Define with -I ../bfd/doc.
* Makefile.in: Regenerate.
* gprof.texi: Include bfdver.texi. Report both VERSION_PACKAGE
and VERSION.
ld:
* ld.texinfo: Include VERSION_PACKAGE when reporting version.
2003-03-22 H.J. Lu <hongjiu.lu@intel.com>
PR ld/4210
* peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the virtual
address and virtual size of the last section for the image
size.
ld/testsuite/
2003-03-22 H.J. Lu <hongjiu.lu@intel.com>
PR ld/4210
* ld-pe/image_size.d: New file.
* ld-pe/image_size.s: Likewise.
* ld-pe/image_size.t: Likewise.
* ld-pe/pe.exp: Run image_size.
* configure.in (REPORT_BUGS_TEXI): Define to Texinfo version of
bug-reporting URL.
* doc/Makefile.am (config.texi): Define BUGURL.
* doc/binutils.texi: Use BUGURL. Remove text about large files
and uuencoding.
* Makefile.in, configure, doc/Makefile.in: Regenerate.
gas:
* configure.in (REPORT_BUGS_TEXI): Define to Texinfo version of
bug-reporting URL.
* doc/Makefile.am (gasver.texi): Define BUGURL.
* doc/as.texinfo: Use BUGURL.
* Makefile.in, configure, doc/Makefile.in: Regenerate.
ld:
* configure.in (REPORT_BUGS_TEXI): Define to Texinfo version of
bug-reporting URL.
* Makefile.am (ldver.texi): Define BUGURL.
* ld.texinfo: Use BUGURL.
* Makefile.in, configure: Regenerate.
200x-xx-xx Phil Edwards <phil@codesourcery.com>
Richard Sandiford <richard@codesourcery.com>
* NEWS: Mention addition of --extract-symbol.
* doc/binutils.texi: Document it.
* objcopy.c (extract_symbol): New variable.
(OPTION_EXTRACT_SYMBOLS): New command_line_switch.
(copy_options): Add an entry for --extract-symbol.
(copy_usage): Mention --extract-symbol.
(copy_object): Set the start address to zero for --extract-symbol.
Do not copy private BFD data in that case.
(setup_section): Set the size, LMA and VMA to zero for
--extract-symbol. Do not copy private BFD data in that case.
(copy_section): Do not copy section contents if --extract-symbol
is passed.
(copy_main): Set extract_symbol to TRUE if --extract-symbol
is passed.
ld/testsuite/
* ld-elf/extract-symbol-1sym.d, ld-elf/extract-symbol-1sec.d,
* ld-elf/extract-symbol-1.s, ld-elf/extract-symbol-1.ld: New tests.
* ld-elf/binutils.exp: Run them.
* ld-arm/arm-elf.exp (armelftests): Move "Thumb-2 BL" test into...
(armeabitests): ... here, a new array for EABI specific tests.
(armelftests): Add extra command line options for VFP11 fix tests and thumb shared library test.
to _binary_spu_ovl_o_start.
(_binary_builtin_ovl_mgr_end): Rename to _binary_spu_ovl_o_end.
(spu_elf_load_ovl_mgr): Fatal error on missing overlay manager.
* emultempl/spu_inc.s: Rename symbols.
* emultempl/spu_none.s: New file.
* emultempl/spu_ovl.S: Update copyright.
* Makefile.am (spu_inc.o): Try building with ld -r first, then
gas incbin, then build without overlay manager.
* Makefile.in: Regenerate.
2076-02-05 H.J. Lu <hongjiu.lu@intel.com>
* ld-i386/pcrel16.d: Undo the last change.
* ld-x86-64/pcrel16.d: Likewise.
opcodes/
2076-02-05 H.J. Lu <hongjiu.lu@intel.com>
* i386-dis.c (OP_J): Undo the last change. Properly handle 64K
wrap around within the same segment in 16bit mode.
2076-02-02 H.J. Lu <hongjiu.lu@intel.com>
* ld-i386/pcrel16.d: Updated.
* ld-x86-64/pcrel16.d: Likewise.
opcodes/
2076-02-02 H.J. Lu <hongjiu.lu@intel.com>
* i386-dis.c (OP_J): Mask to 16bit only if there is a data16
prefix.
* ld-arm/vfp11-fix-none.s: New file.
* ld-arm/vfp11-fix-none.d: Expected disassembly of above.
* ld-arm/vfp11-fix-scalar.s: New file.
* ld-arm/vfp11-fix-scalar.d: Expected disassembly of above.
* ld-arm/vfp11-fix-vector.s: New file.
* ld-arm/vfp11-fix-vector.d: Expected disassembly of above.
2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
* ld.h (args_type): Add new symbolic and dynamic_list fields.
* ld.texinfo: Update -Bsymbolic-functions.
* ldmain.c (main): Initialize command_line.symbolic to
symbolic_unset and command_line.dynamic_list to
dynamic_list_unset. Check -Bsymbolic, -Bsymbolic-functions and
--dynamic-list* before setting link_info.symbolic,
link_info.dynamic and link_info.dynamic_data.
* lexsup.c (option_values): Add OPTION_SYMBOLIC_FUNCTIONS.
(ld_options): Use OPTION_SYMBOLIC_FUNCTIONS with
-Bsymbolic-functions.
(parse_args): Handle -Bsymbolic-functions. Don't set
link_info.dynamic, link_info.dynamic_data and link_info.symbolic
here. Set command_line.symbolic for -Bsymbolic. Set
command_line.dynamic_list and command_line.symbolic for
--dynamic-list-data, --dynamic-list-cpp-new,
--dynamic-list-cpp-typeinfo and --dynamic-list.
ld/testsuite/
2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/dl6.c: New file.
* ld-elf/dl6a.out: Likewise.
* ld-elf/dl6amain.c: Likewise.
* ld-elf/dl6b.out: Likewise.
* ld-elf/dl6bmain.c: Likewise.
* ld-elf/dl6cmain.c: Likewise.
* ld-elf/dl6dmain.c: Likewise.
* ld-elf/shared.exp: Add new tests for -Bsymbolic,
-Bsymbolic-functions, --dynamic-list-data and
--dynamic-list-cpp-new.
2007-01-19 Jakub Jelinek <jakub@redhat.com>
H.J. Lu <hongjiu.lu@intel.com>
* emultempl/elf32.em (handle_option): Make sure -z max-page-size
or -z common-page-size argument is a power of 2. Call
bfd_emul_set_maxpagesize and bfd_emul_set_commonpagesize.
2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
* ldmain.c (main): Don't call bfd_emul_set_maxpagesize nor
bfd_emul_set_commonpagesize.
ld/testsuite/
2007-01-19 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/maxpage3.t: New file.
* ld-elf/maxpage3a.d: Likewise.
* ld-elf/maxpage3b.d: Likewise.
* ld-elf/maxpage3c.d: Likewise.
2007-01-16 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3831
* elf-bfd.h (bfd_elf_link_mark_dynamic_symbol): Add an
argument, Elf_Internal_Sym *.
* elflink.c (bfd_elf_link_mark_dynamic_symbol): Mark a data
symbol dynamic if info->dynamic_data is TRUE.
(bfd_elf_record_link_assignment): Updated call to
bfd_elf_record_link_assignment.
(_bfd_elf_merge_symbol): Likewise. Always call
bfd_elf_link_mark_dynamic_symbol.
include/
2007-01-16 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3831
* bfdlink.h (bfd_link_info): Rename dynamic to dynamic_list.
Add dynamic and dynamic_data.
ld/
2007-01-16 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3831
* NEWS: Mention -Bsymbolic-functions, --dynamic-list-data and
--dynamic-list-cpp-new.
* ld.texinfo: Document -Bsymbolic-functions, --dynamic-list-data
and --dynamic-list-cpp-new.
* ldlang.c (lang_append_dynamic_list_cpp_new): New.
(lang_process): Change link_info.dynamic to
link_info.dynamic_list.
(lang_append_dynamic_list): Likewise.
* ldmain.c (main): Likewise. Initialize link_info.dynamic and
link_info.dynamic_data to FALSE.
* ldlang.h (lang_append_dynamic_list_cpp_new): New.
* lexsup.c (option_values): Add OPTION_DYNAMIC_LIST_DATA and
OPTION_DYNAMIC_LIST_CPP_NEW.
(ld_options): Add entries for -Bsymbolic-functions,
--dynamic-list-data and --dynamic-list-cpp-new. Make
-Bsymbolic-functions an alias of --dynamic-list-data.
(parse_args): Change link_info.dynamic to link_info.dynamic_list.
Set link_info.dynamic to TRUE for --dynamic-list and
--dynamic-list-cpp-typeinfo. Handle --dynamic-list-data and
--dynamic-list-cpp-new.
ld/testsuite/
2007-01-16 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3831
* ld-elf/del.cc: New.
* ld-elf/dl5.cc: Likewise.
* ld-elf/dl5.out: Likewise.
* ld-elf/new.cc: Likewise.
* ld-elf/shared.exp: Add tests for --dynamic-list-data and
--dynamic-list-cpp-new.
* elf.c (assign_file_positions_for_load_sections): We can
require fewer phdrs than expected.
ld/
* emultempl/elf-generic.em (gdl_map_segments): Only allow header
shrinkage for the first few iterations.
ld/testsuite/
* ld-elf/header.d: New.
* ld-elf/header.t: New.
* ld-elf/header.s: New.
2006-12-29 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (elf_link_add_object_symbols): Remember the symbol
size only if it is defined.
ld/testsuite/
2006-12-29 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/wrap.exp: New file.
* ld-elf/wrap1.c: Likewise.
* ld-elf/wrap1.out: Likewise.
* ld-elf/wrap1a.c: Likewise.
* ld-elf/wrap1b.c: Likewise.
* pe-dll.h (pe_bfd_is_dll): Declare.
* emultempl/pe.em (gld_${EMULATION_NAME}_recognized_file): Recognize dlls using
pe_bfd_is_dll instead of using the filename extension.
shared_data): If !SHARED, move to...
* ld-elfvsb/sh2.c: ... here.
* ld-elfvsb/elfvsb.exp: Add -DSHARED to compiler options when
building with $picflag.
* elf32-xtensa.c (elf_xtensa_special_sections): Add .xtensa.info.
gas/
* config/tc-xtensa.c (XSHAL_ABI): Add default definition.
(directive_state): Disable scheduling by default.
(xtensa_add_config_info): New.
(xtensa_end): Call xtensa_add_config_info.
gas/testsuite/
* gas/elf/section2.e-xtensa: New file.
* gas/elf/elf.exp: Use it.
include/
* xtensa-config.h (XSHAL_ABI): New.
(XTHAL_ABI_WINDOWED, XTHAL_ABI_CALL0): New.
ld/
* emultempl/xtensaelf.em (XSHAL_ABI): Add default definition.
(replace_insn_sec_with_prop_sec): Use bfd_make_section_with_flags.
Delete redundant code to set sections flags and alignment.
(xt_config_info_unpack_and_check, check_xtensa_info): New.
(elf_xtensa_after_open): Iterate over input statements instead of
link_info.input_bfds.
(elf_xtensa_before_allocation): Likewise. Call check_xtensa_info for
each input, and write a new .xtensa.info section in the output.
* arm-dis.c (last_is_thumb): Delete.
(enum map_type, last_type): New.
(print_insn_data): New.
(get_sym_code_type): Take MAP_TYPE argument. Check the type of
the right symbol. Handle $d.
(print_insn): Check for mapping symbols even without a normal
symbol. Adjust searching. If $d is found see how much data
to print. Handle data.
gas/
* config/tc-arm.h (md_cons_align): Define.
(mapping_state): New prototype.
* config/tc-arm.c (mapping_state): Make global.
gas/testsuite/
* gas/arm/arm7t.d, gas/arm/neon-ldst-rm.d, gas/arm/thumb2_pool.d,
gas/arm/tls.d: Update for $d support.
* gas/arm/mapshort.d, gas/arm/mapshort.s: New test.
* gas/elf/section2.e-armeabi: Update.
* gas/elf/section2.e-armelf: New file.
* gas/elf/elf.exp: Use it.
ld/testsuite/
* ld-arm/mixed-app.d, ld-arm/tls-app.d, ld-arm/tls-lib.d: Update
for $d support.
(cie_compare): Removed.
(cie_eq, cie_hash, cie_compute_hash): New functions.
(_bfd_elf_discard_section_eh_frame): Rewrite not to rely on FDEs
pointing only to last CIE and allow merging of any duplicate CIEs,
not just duplicate consecutive CIEs.
(_bfd_elf_discard_section_eh_frame_hdr): Delete cies hash table.
* elf-bfd.h (struct cie_header, struct cie): Removed.
(struct eh_frame_sec_info): Remove alloced field.
(struct eh_frame_hdr_info): Remove last_cie, last_cie_sec
and last_cie_inf fields. Add cies field.
* ld-elf/eh5.d: New test.
* ld-elf/eh5.s: New file.
* ld-elf/eh5a.s: New file.
* ld-elf/eh5b.s: New file.
* elf-bfd.h (local_call_stubs): New member.
* elfxx-mips.c (FN_STUB_P, CALL_STUB_P, CALL_FP_STUB_P): New macros.
(mips_elf_calculate_relocation): Handle local mips16 call stubs.
(mips16_stub_section_p): Rename from mips_elf_stub_section_p, use
the new stub macros.
(_bfd_mips_elf_check_relocs): Handle call stubs for code which
mixes mips16 and mips32 functions. Use mips16_stub_section_p. Mark
used stubs with SEC_KEEP. Use the new stub macros.
[ gas/testsuite/ChangeLog ]
* gas/mips/mips16-intermix.d, gas/mips/mips16-intermix.s: New
testcase.
* gas/mips/mips.exp: Run new testcase.
[ ld/testsuite/ChangeLog ]
* ld-mips-elf/mips16-intermix-1.s, ld-mips-elf/mips16-intermix-2.s,
ld-mips-elf/mips16-intermix.d: New testcase.
* ld-mips-elf/mips-elf.exp (mips16_intermix_test): Run new testcases.
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make the
size of .rel.dyn reflect the value of DT_RELSZ.
ld/testsuite/
* ld-mips-elf/multi-got-1.d: Remove trailing R_MIPS_NONE entries.
* ld-mips-elf/tls-multi-got-1.got: Likewise.
* ld-mips-elf/tls-multi-got-1.r: Likewise.
* elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Allocate
a PT_NULL header for dynamic objects.
(_bfd_mips_elf_modify_segment_map): Add it.
ld/testsuite/
* ld-mips-elf/multi-got-1.d: Do not expect a particular address
for DT_HASH.
* ld-mips-elf/rel32-o32.d: Bump addresses by 0x20 to account for
the extra program header.
* ld-mips-elf/rel32-n32.d: Likewise.
* ld-mips-elf/tlslib-o32.got: Likewise.
* ld-mips-elf/tlslib-o32-hidden.got: Likewise.
* ld-mips-elf/tlslib-o32-ver.got: Likewise.
* ld-mips-elf/tls-multi-got-1.got: Likewise.
* ld-mips-elf/tls-multi-got-1.r: Likewise.
* ld-mips-elf/rel64.d: Bump addresses by 0x30 to account for the
extra program header.
* ld-mips-elf/tlsdyn-o32.d: Reduce the GOT offset by 32 to account
for the extra program header, and thus the shorter gap between the
text and data segments.
* ld-mips-elf/tlsdyn-o32-1.d: Likewise.
* ld-mips-elf/tlsdyn-o32-2.d: Likewise.
* ld-mips-elf/tlsdyn-o32-3.d: Likewise.
* ld-mips-elf/tlsdyn-o32.got: Bump GOT text addresses by 0x20
to account for the extra program header.
* ld-mips-elf/tlsdyn-o32-1.got: Likewise.
* ld-mips-elf/tlsdyn-o32-2.got: Likewise.
* ld-mips-elf/tlsdyn-o32-3.got: Likewise.
* emulparams/elf32bmip.sh (OTHER_GOT_RELOC_SECTIONS): Define.
* emulparams/elf32bmipn32-defs.sh (OTHER_GOT_RELOC_SECTIONS): Likewise.
ld/testsuite/
* ld-mips-elf/rel32-o32.d: Bump the section number of .text by 1
to account for the fact that .rel.dyn is now before .text in the
section table.
* ld-mips-elf/rel32-n32.d: Likewise.
* ld-mips-elf/rel64.d: Likewise.
* elfxx-mips.c (sort_dynamic_relocs): Sort relocations against the
same symbol by increasing r_offset.
(sort_dynamic_relocs_64): Likewise. Fix comparisons between very
large and very small symbol indexes.
ld/testsuite/
* ld-mips-elf/tlslib-o32-hidden.got: Sort relocations against the
same symbol in order of increasing r_offset.
* ld-mips-elf/tls-multi-got-1.got: Likewise.
* ld-mips-elf/tls-hidden3.r: Likewise.
* ld-mips-elf/tls-hidden4.r: Likewise.
* elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG
and DT_MIPS_RLD_MAP tags for position-independent executables.
Do not add DT_DEBUG to shared libraries for any MIPS target.
ld/testsuite/
* ld-mips-elf/multi-got-1.d: Remove DT_DEBUG tag. Do not require
a specific file offset for .dynamic. Reduce DT_HASH by 8 to account
for removed tag.
* ld-mips-elf/tls-multi-got-1.r: Likewise. Also reduce DT_REL by 8.
Reduce PLTGOT and symbol values by 16 to account for the removed tag.
* ld-mips-elf/textrel-1.d: Remove DT_DEBUG tag.
* ld-mips-elf/rel32-n32.d: Reduce addresses by 16 to account for
removed DT_DEBUG tag.
* ld-mips-elf/rel64.d: Likewise.
* ld-mips-elf/tls-multi-got-1.got: Likewise.
* ld-mips-elf/tlslib-o32-hidden.got: Likewise.
* bfd/elf64-sparc.c: Add FreeBSD support.
(elf64_sparc_fbsd_post_process_headers): New function.
* bfd/targets.c (_bfd_target_vector): Add bfd_elf64_sparc_freebsd_vec.
* bfd/config.bfd (sparc64-*-freebsd*): Set targ_defvec to bfd_elf64_sparc_freebsd_vec.
* bfd/configure.in: Add entry for bfd_elf64_sparc_freebsd_vec.
* bfd/configure: Regenerate.
* gas/config/tc-sparc.c (md_parse_option): Treat any target starting with elf32-sparc
as a viable target for the -32 switch and any target starting with elf64-sparc as a
viable target for the -64 switch.
(sparc_target_format): For 64-bit ELF flavoured output use ELF_TARGET_FORMAT64
while for 32-bit ELF flavoured output use ELF_TARGET_FORMAT.
* gas/config/tc-sparc.h (ELF_TARGET_FORMAT, ELF_TARGET_FORMAT64): Define.
* ld/emulparams/elf64_sparc_fbsd.sh (OUTPUT_FORMAT): Define as elf64-sparc-freebsd.
* ld-mips-elf/rel32-n32.d: Bump addresses by 0x30 to account for
the fact that .reginfo is now placed before .text. Change the
section number of .text accordingly.
* ld-mips-elf/elf-rel-got-n32.d: Adjust page gap from 0x100000
to 0x10000. Move .reginfo before .text and bump .text addresses
by 0x10 to make room. Move data segment down by 0x10 bytes to
account for new size of text segment.
* ld-mips-elf/elf-rel-xgot-n32.d: Likewise.
* ld-mips-elf/elf-rel-got-n64-linux.d: Adjust page gap from
0x100000 to 0x10000.
* ld-mips-elf/elf-rel-xgot-n64-linux.d: Likewise.
* Makefile.am (eelf64bmip.c): Depend on emulparams/elf64bmip-defs.sh.
(eelf64btsmip.c, eelf64ltsmip.c): Likewise.
* Makefile.in: Regenerate.
* emulparams/elf32bmipn32-defs.sh (INITIAL_READONLY_SECTIONS): Include
.reginfo rather than .MIPS.options.
* emulparams/elf64bmip-defs.sh: New file.
* emulparams/elf64bmip.sh: Include it.
(COMMONPAGESIZE): Delete.
* emulparams/elf64btsmip.sh: As for elf64bmip.sh.
ld/testsuite/
* ld-mips-elf/branch-misc-1.d: Set the start address to 0x20000000.
* ld-mips-elf/jalbal.d: Likewise 0x200000a0.
* ld-mips-elf/jaloverflow-2.d: Likewise 0x20000000.
* ld-mips-elf/reloc-3-n32.d: Likewise.
* ld-mips-elf/reloc-3.d: Likewise.
* ld-mips-elf/textrel-1.d: Don't require a specific file offset for
.dynamic.
* emulparams/elf32xtensa.sh: Set MAXPAGESIZE here instead of including
xtensa-config.sh.
* Makefile.am (eelf32xtensa.c): Remove dependency on xtensa-config.sh.
* Makefile.in: Regenerate.
* elf-eh-frame.c (skip_cfa_op): Fix handling of DW_CFA_advance_loc.
Handle DW_CFA_{remember,restore}_state, DW_CFA_GNU_window_save,
DW_CFA_val_{offset{,_sf},expression}.
(skip_non_nops): Record number of DW_CFA_set_loc ops.
(_bfd_elf_discard_section_eh_frame): Require skip_non_nops recognizes
all ops. If there are any DW_CFA_set_loc ops and they are pcrel
or going to be pcrel, compute set_loc array.
(_bfd_elf_eh_frame_section_offset): If make_relative, kill relocations
against DW_CFA_set_loc operands.
(_bfd_elf_write_section_eh_frame): Handle DW_CFA_set_loc adjusting.
* ld-elf/eh4.d: New test.
* ld-elf/eh4.s: New file.
* ld-elf/eh4a.s: New file.
(autofilter_symbolprefixlist) : Remove __imp_.
(is_import) : New.
(auto-export) : Remove re-import check. Moved to callers.
(process_def_file) : Check is symbol is an import. Always underscore __imp_.
Only skip underscore on underscored targets.
(make_one) : Always underscore __imp_.
(pe_create_runtime_relocator_reference) : Only underscore _pei386_runtime_relocator on underscored targets.
(pe_process_import_defs) : Always underscore __imp_.
* pe.em (U) : New macro.
(set_pe_subsystem) : Remove underscore from _WinMainCRTStartup on wince subsystem case.
(pe_find_data_imports) : Use U on "_head_".
(gld_${EMULATION_NAME}_unrecognized_file) : Use U.
PR ld/3249
* scripttempl/elf.sc: Don't combine .gnu.linkonce.d.*personality*
and .gnu.linkonce.wi.* sections with .data and .debug_info for
relocatable link.
argument and emits the string followed by a comma and then the length of
the string.
(CONST_STRNEQ): New macro. Checks to see if a variable string has a constant
string as its initial characters.
(CONST_STRNCPY): New macro. Copies a constant string to the start of a
variable string.
* bfd-in2.h: Regenerate.
* <remainign files>: Make use of the new macros.
2006-09-12 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3197
* elflink.c (elf_link_output_extsym): Compute bucket only if
needed.
ld/testsuite/
2006-09-12 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3197
* ld-elf/hash.d: New test.
* elf32-xtensa.c (xtensa_get_property_section_name): Delete.
(xtensa_get_property_section): New.
(xtensa_read_table_entries): Use xtensa_get_property_section.
(relax_property_section, xtensa_get_property_predef_flags): Handle
group name suffixes in property section names.
(match_section_group): New.
gas/
* config/tc-xtensa.c (FINI_LITERAL_SECTION_NAME): Delete.
(INIT_LITERAL_SECTION_NAME): Delete.
(lit_state struct): Remove segment names, init_lit_seg, and
fini_lit_seg. Add lit_prefix and current_text_seg.
(init_literal_head_h, init_literal_head): Delete.
(fini_literal_head_h, fini_literal_head): Delete.
(xtensa_begin_directive): Move argument parsing to
xtensa_literal_prefix function.
(xtensa_end_directive): Deallocate lit_prefix field of lit_state.
(xtensa_literal_prefix): Parse the directive argument here and
record it in the lit_prefix field. Remove code to derive literal
section names.
(linkonce_len): New.
(get_is_linkonce_section): Use linkonce_len. Check for any
".gnu.linkonce.*" section, not just text sections.
(md_begin): Remove initialization of deleted lit_state fields.
(xtensa_reorder_segments, xtensa_post_relax_hook): Remove references
to init_literal_head and fini_literal_head.
(xtensa_move_literals): Likewise. Skip literals for .init and .fini
when traversing literal_head list.
(match_section_group): New.
(cache_literal_section): Rewrite to determine the literal section
name on the fly, create the section and return it.
(xtensa_switch_to_literal_fragment): Adjust for cache_literal_section.
(xtensa_switch_to_non_abs_literal_fragment): Likewise.
(xtensa_create_property_segments, xtensa_create_xproperty_segments):
Use xtensa_get_property_section from bfd.
(retrieve_xtensa_section): Delete.
* doc/c-xtensa.texi (Xtensa Options): Fix --text-section-literals
description to refer to plural literal sections and add xref to
the Literal Directive section.
(Literal Directive): Describe new rules for deriving literal section
names. Add footnote for special case of .init/.fini with
--text-section-literals.
(Literal Prefix Directive): Replace old naming rules with xref to the
Literal Directive section.
ld/
* emulparams/elf32xtensa.sh (.xt.prop): Add .xt.prop.*.
* scripttempl/elfxtensa.sc (.text): Add .literal.*.
* Makefile.am: Add rules to build pe-arm-wince.lo and pei-arm-wince.lo objects.
* Makefile.in: Regenerate.
* pe-arm-wince.c: New file.
* pei-arm-wince.c: New file.
* pei-arm.c: Remove ARM_WINCE block.
* pe-arm.c: Remove ARM_WINCE block. Rename
bfd_arm_pe_allocate_interworking_sections,
bfd_arm_pe_get_bfd_for_interworking, and
bfd_arm_pe_process_before_allocation to
bfd_armpe_allocate_interworking_sections,
bfd_armpe_get_bfd_for_interworking, and
bfd_armpe_process_before_allocation. Move them before including bfd.h.
* bfd.c: ARM wince bfd format names were renamed. Adjust.
* coff-arm.c [ARM_WINCE]: Adjust so Windows CE doesn't end up with unexpected/conflicting relocs.
* targets.c: The arm-wince-pe target got its own new vector. Adjust.
* config.bfd: Likewise.
* configure.in: Likewise.
* configure: Regenerate.
binutils
* configure.in: Split arm-pe and arm-wince-pe. Build dlltool with -DDLLTOOL_ARM_WINCE for Windows CE case.
* configure: Regenerate.
* dlltool.c: Add support for arm-wince.
gas
* Makefile.am (TARG_ENV_HFILES): Add te-wince-pe.h.
* Makefile.in: Regenerate.
* config/tc-arm.h [TARGET_FORMAT]: ARM wince bfd names were renamed. Adjust.
ld
* Makefile.am: Split arm-wince into its own emulation.
* Makefile.in: Regenerate.
* configure.tgt: Set targ_emul to arm_wince_pe for ARM Windows CE targets.
* pe-dll.c : Define PE_ARCH_arm_wince.
(pe_detail_list): Add PE_ARCH_arm_wince case.
(make_one): Handle PE_ARCH_arm_epoc and PE_ARCH_arm_wince cases.
* emulparams/arm_wince_pe.sh: New file.
* emultempl/pe.em: Handle new TARGET_IS_arm_wince_pe define.
Remap bfd_arm_allocate_interworking_sections, bfd_arm_get_bfd_for_interworking and
bfd_arm_process_before_allocation for arm-pe and arm-wince-pe targets too.
(gld_${EMULATION_NAME}_recognized_file): Handle arm-wince and arm-epoc bfd format names.
2006-08-16 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3015
* elf.c (get_program_header_size): Add a PT_GNU_RELRO segment
only if there is a PT_DYNAMIC segment.
(_bfd_elf_map_sections_to_segments): Likewise.
(assign_file_positions_for_load_sections): Set PT_GNU_RELRO
segment alignment to 1.
ld/testsuite/
2006-08-16 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3015
* ld-elf/binutils.exp: Add tests for "-z relro".
PR 3052
* ldlang.h (lang_output_section_statement_type): Replace
"processed" field with "processed_vma" and "processed_lma".
* ldlang.c (lang_do_assignments_1): Move lma setting code..
(lang_size_sections_1): ..to here.
(lang_reset_memory_regions): Adjust for
lang_output_section_statement_type change.
* ldexp.c (fold_name): Likewise.
And this is something I forgot the check in from the previous patch.
ld/testsuite/
* ld-scripts/overlay-size-map.d: Adjust.
PR ld/3006
* ldlang.c (lang_section_bst_type): Moved to ...
* ldlang.h: Here.
* ldlang.h (lang_wild_statement_struct): Add a tree field.
* ldlang.c (wild_sort_fast): Use the tree field for BST.
(wild): Likeise.
(analyze_walk_wild_section_handler): Initialize the tree field.
* coff-arm.c (coff_arm_rtype_to_howto) [COFF_WITH_PE]: Handle ARM_SECREL.
(coff_arm_reloc_type_lookup): Map BFD_RELOC_32_SECREL to ARM_SECREL.
* pe-arm.c [COFF_SECTION_ALIGNMENT_ENTRIES]: Define.
* pei-arm.c [TARGET_UNDERSCORE]: Define for ARM_WINCE like in pe-arm.c.
[COFF_SECTION_ALIGNMENT_ENTRIES]: Define.
* config/tc-arm.c: Move "dwarf2dbg.h" inclusion out of OBJ_ELF only block.
(pe_directive_secrel) [TE_PE]: New function.
(md_pseudo_table) [!OBJ_ELF]: Handle 2byte, 4byte, 8byte, file, loc, loc_mark_labels.
[TE_PE]: Handle secrel32.
(output_relax_insn): Remove OBJ_ELF around dwarf2_emit_insn call.
(output_inst): Remove OBJ_ELF around dwarf2_emit_insn call.
(arm_frob_label): Remove OBJ_ELF around dwarf2_emit_label call.
(md_section_align): Only round section sizes here for AOUT targets.
(tc_arm_regname_to_dw2regnum): Move out for OBJ_ELF only block.
(tc_pe_dwarf2_emit_offset): New function.
(md_apply_fix) [TE_PE]: Handle BFD_RELOC_32_SECREL.
(cons_fix_new_arm): Handle O_secrel.
* config/tc-arm.h : Move DWARF2_LINE_MIN_INSN_LENGTH, DWARF2_DEFAULT_RETURN_COLUMN and DWARF2_CIE_DATA_ALIGNMENT out of OBJ_ELF only block.
[TE_PE]: Define O_secrel, TC_DWARF2_EMIT_OFFSET, and declare tc_pe_dwarf2_emit_offset.
* ld-pe/pe.exp: Enable tests on arm-wince-pe.
* ld-pe/secrel.d: Adjust test to work on arm-wince-pe too.
* lexsup.c: Add --print-gc-sections and --no-print-gc-sections switches.
* ld.texinfo: Document new switches.
* NEWS: Mention new switches.
* bfdlink.h (struct bfd_link_info): New field: print_gc_sections.
* elflink.c (elf_gc_sweep): If info.print_gc_sections is true, list removed sections to stderr.
2006-08-02 Richard Sandiford <richard@codesourcery.com>
Kazu Hirata <kazu@codesourcery.com>
Phil Edwards <phil@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
* config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and
bfd_elf32_shlvxworks_vec.
* configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo.
(bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise.
(bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise.
(bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise.
(bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise.
(bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise.
(bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise.
(bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas.
* configure: Regenerate.
* Makefile.am: Regenerate dependencies.
* Makefile.in: Regenerate.
* elf-vxworks.c (elf_vxworks_gott_symbol_p): New function.
(elf_vxworks_add_symbol_hook): Use it.
(elf_vxworks_link_output_symbol_hook): Likewise. Use the hash
table entry to check for weak undefined symbols and to obtain
the original bfd.
(elf_vxworks_emit_relocs): Use target_index instead of this_idx.
* elf32-sh-relocs.h: New file, split from elf32-sh.c.
(R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field,
SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the
special_function field.
(R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too.
(R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise.
(R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise.
(R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise.
(R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise.
(R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise.
(SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file.
* elf32-sh.c: Include elf32-vxworks.h.
(MINUS_ONE): Define.
(sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32
set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set
to sh_elf_reloc.
(sh_vxworks_howto_table): New variable. Include elf32-sh-relocs.h
with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and
SH_ELF_RELOC set to bfd_elf_generic_reloc.
(vxworks_object_p, get_howto_table): New functions.
(sh_elf_reloc_type_lookup): Fix typo. Use get_howto_table.
(sh_elf_info_to_howto): Use get_howto_table.
(sh_elf_relax_section): Honor the partial_inplace field of the
R_SH_DIR32 howto.
(sh_elf_relax_delete_bytes): Likewise.
(elf_sh_plt_info): New structure.
(PLT_ENTRY_SIZE): Replace both definitions with...
(ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for
INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
(elf_sh_plt0_entry_be): Update sizes of both definitions accordingly.
(elf_sh_plt0_entry_le): Likewise.
(elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise.
(elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise.
(elf_sh_plts): New structure, with separate definitions for
INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
(elf_sh_plt0_entry): Delete both definitions.
(elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise.
(elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise.
(elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise.
(elf_sh_plt_reloc_offset): Likewise.
(movi_shori_putval): Delete in favor of...
(install_plt_field): ...this new function, with separate definitions
for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
(get_plt_info): New function, with separate definitions
for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
(elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete.
(VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros.
(vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants.
(vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise.
(vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise.
(get_plt_index, get_plt_offset): New functions.
(elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields.
(sh_elf_link_hash_table_create): Initialize them.
(sh_elf_create_dynamic_sections): Call
elf_vxworks_create_dynamic_sections for VxWorks.
(allocate_dynrelocs): Use htab->plt_info to get the size of PLT
entries. Allocate relocation entries in .rela.plt.unloaded if
generating a VxWorks executable.
(sh_elf_always_size_sections): New function.
(sh_elf_size_dynamic_sections): Extend .rela.plt handling to
.rela.plt.unloaded.
(sh_elf_relocate_section): Use get_howto_table. Honor
partial_inplace when calculating the addend for dynamic
relocations. Use get_plt_index.
(sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field
and htab->plt_info. Fill in the bra .plt offset for VxWorks
executables. Populate .rela.plt.unloaded. Do not make
_GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
(sh_elf_finish_dynamic_sections): Use install_plt_field and
htab->plt_info. Handle cases where there is no special PLT header.
Populate the first relocation in .rela.plt.unloaded and fix up
the remaining entries.
(sh_elf_plt_sym_val): Use get_plt_info.
(elf_backend_always_size_sections): Define.
(TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks.
(TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
(elf32_bed, elf_backend_want_plt_sym): Likewise.
(elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise.
(elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise.
(elf_backend_add_symbol_hook): Likewise.
(elf_backend_link_output_symbol_hook): Likewise.
(elf_backend_emit_relocs): Likewise.
(elf_backend_final_write_processing): Likewise.
(ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise.
* targets.c (bfd_elf32_shlvxworks_vec): Declare.
(bfd_elf32_shvxworks_vec): Likewise.
(_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and
bfd_elf32_shvxworks_vec.
gas/
* config/tc-sh.c (apply_full_field_fix): New function.
(md_apply_fix): Use it instead of md_number_to_chars. Do not fill
in fx_addnumber for BFD_RELOC_32_PLT_PCREL.
(tc_gen_reloc): Use fx_addnumber rather than 0 as the default case.
* config/tc-sh.h (TARGET_FORMAT): Override for TE_VXWORKS.
ld/
2006-08-02 Richard Sandiford <richard@codesourcery.com>
Kazu Hirata <kazu@codesourcery.com>
Phil Edwards <phil@codesourcery.com>
* Makefile.am (ALL_EMULATIONS): Add eshelf_vxworks.o and
eshlelf_vxworks.o.
(eshelf_vxworks.c, eshlelf_vxworks.c): New rules.
* Makefile.in: Regenerate.
* configure.tgt (sh-*-vxworks): Use shelf_vxworks and
shlelf_vxworks.
* emulparams/shelf_vxworks.sh: New file.
* emulparams/shlelf_vxworks.sh: Likewise.
* emulparams/vxworks.sh (FINI): Prefix _etext with ${SYMPREFIX}.
(OTHER_END_SYMBOLS): Likewise _ehdr.
(DATA_END_SYMBOLS): Likewise _edata.
* emultempl/vxworks.em (vxworks_after_open): Check whether output_bfd
is indeed an ELF file before dealing with --force-dynamic.
ld/testsuite/
* ld-sh/rd-sh.exp: Treat vxworks1-static.d specially.
* ld-sh/sh-vxworks.exp: New file.
* ld-sh/sh.exp: Extend sh-linux SIZEOF_HEADERS handling to
sh-*-vxworks.
* ld-sh/vxworks1-le.dd, ld-sh/vxworks1-lib-le.dd,
* ld-sh/vxworks1-lib.dd, ld-sh/vxworks1-lib.nd,
* ld-sh/vxworks1-lib.rd, ld-sh/vxworks1-lib.s,
* ld-sh/vxworks1-static.d, ld-sh/vxworks1.dd,
* ld-sh/vxworks1.ld, ld-sh/vxworks1.rd, ld-sh/vxworks1.s,
* ld-sh/vxworks2-static.sd, ld-sh/vxworks2.s,
* ld-sh/vxworks2.sd, ld-sh/vxworks3-le.dd,
* ld-sh/vxworks3-lib-le.dd, ld-sh/vxworks3-lib.dd,
* ld-sh/vxworks3-lib.s, ld-sh/vxworks3.dd, ld-sh/vxworks3.s,
* ld-sh/vxworks4.d, ld-sh/vxworks4a.s, ld-sh/vxworks4b.s,
* ld-sh/reloc1.s, ld-sh/reloc1.d: New tests.
* bfd/elf64-x86-64.c: Add FreeBSD support.
(elf64_x86_64_fbsd_post_process_headers): New function.
* bfd/targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec.
* bfd/config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec to the targ_selvecs.
* bfd/configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec.
* bfd/configure: Regenerate.
* gas/config/tc-i386.c (md_parse_option): Treat any target starting with elf64_x86_64 as a viable target for the -64 switch.
(i386_target_format): For 64-bit ELF flavoured output use ELF_TARGET_FORMAT64.
* gas/config/tc-i386.h (ELF_TARGET_FORMAT64): Define.
* ld/emulparams/elf_x86_64_fbsd.sh (OUTPUT_FORMAT): Define as elf64-x86-64-freebsd.
(wild_sort_fast): New function: Insert a section into a binary search tree.
(output_section_callback_fast): New function: Store a section in BST.
(output_section_callback_tree_to_list): New function: Convert a BST into a list.
(analyze_walk_wild_section_handler): Initialize handler_data elements.
(wild): If the data is sorted by name use the BST method to sort the names.