aboutsummaryrefslogtreecommitdiff
path: root/gold
AgeCommit message (Collapse)AuthorFilesLines
2016-12-13[GOLD] Allow for larger alignment in script_test_15Alan Modra4-3/+10
PowerPC64 aligns .got to a 256 byte boundary. This tends to bump the data segment file size. PR gold/16711 * testsuite/script_test_15a.sh: Allows larger p_filesz. * testsuite/script_test_15b.sh: Likewise. * testsuite/script_test_15c.sh: Likewise.
2016-12-13[GOLD] Adjust testcase for PowerPC64Alan Modra2-0/+6
Since the linker created .TOC. symbol is placed at roughly .got+32k, .toc input sections must be placed in or after .got if .toc entries are accessed using 16-bit signed offset relocs. crt1.o contains such a relocation. PR gold/20717 * testsuite/pr20717.t: Add .got output section containing .toc.
2016-12-11Fix earlier ChangeLog entry to give Igor credit, add testcases.Igor Kudrin7-6/+81
2016-12-01 Cary Coutant <ccoutant@gmail.com> Igor Kudrin <ikudrin@accesssoftek.com> PR gold/20717 * script-sections.cc (Script_sections): Set *keep to false when no match. 2016-12-11 Igor Kudrin <ikudrin@accesssoftek.com> PR gold/20717 * testsuite/Makefile.am (pr20717): New test. * testsuite/Makefile.in: Regenerate. * testsuite/pr20717.c: New test source file. * testsuite/pr20717.sh: New test script. * testsuite/pr20717.t: New test linker script.
2016-12-11Fix problems with bss handling in linker scripts.Cary Coutant14-52/+463
PR 16711 noted that gold allocates file space for BSS sections when using a linker script. I've fixed that by rewriting set_section_addresses and set_section_list_addresses to track the file offset separate from the current virtual address, so that BSS sections do not move the file offset. Now, if a series of BSS sections come at the end of a segment, we do not allocate file space; but if a script forces them into the middle of a segment, we will still allocate file space (matching Gnu ld behavior). I've also added a warning when that happens. That exposed another problem where orphan .bss sections were sometimes placed in the middle of a segment. For example, if the script mentions the .got section, but both .data and .bss are orphans, gold would put both .data and .bss in front of .got. I've fixed that by ensuring that orphan BSS sections are always placed after all other allocated sections. It also exposed a problem where the SUBALIGN property is not handled properly. The ld manual clearly states that it should override input section alignment, whether greater or less than the given alignment, but gold would only increase an input section's alignment. Gold would also place the output section based on its original alignment before the SUBALIGN property took effect, leading to a misaligned output section (where the input section was properly aligned in memory, but was not aligned relative to the start of the section), in violation of the ELF/gABI spec. I've fixed that by making sure that the SUBALIGN property overrides the internal alignment of the input sections as well as the external alignment of the output section. This affected the behavior of script_test_2, which was written to expect a misaligned section. The net effect is, I think, improved compatibility with the BFD linker. There are still cases where orphan placement differs, but the differences should be rarer and less important. ALIGN and SUBALIGN behavior is closer, but still not an exact match -- I still found cases where ld would create a misaligned output section, and where gold will properly align it. gold/ PR gold/16711 * output.cc (Output_section::set_final_data_size): Calculate data size based on relative offset rather than file offset. (Output_segment::set_section_addresses): Track file offset separately from address offset. (Output_segment::set_section_list_addresses): Add pfoff parameter. Track file offset separately. Don't move file offset for BSS sections. * output.h (Output_segment::set_section_list_addresses): Add pfoff parameter. * script-sections.cc (Orphan_section_placement): Add PLACE_LAST_ALLOC. (Orphan_section_placement::Orphan_section_placement): Initialize it. (Orphan_section_placement::output_section_init): Track last allocated section. (Orphan_section_placement::find_place): Place BSS after last allocated section. (Output_section_element_input::set_section_addresses): Always override input section alignment when SUBALIGN is specified. (Output_section_definition::set_section_addresses): Override alignment of output section when SUBALIGN is specified. * testsuite/Makefile.am (script_test_15a, script_test_15b) (script_test_15c): New test cases. * testsuite/Makefile.in: Regenerate. * testsuite/script_test_2.cc: Adjust expected layout. * testsuite/script_test_15.c: New source file. * testsuite/script_test_15a.sh: New shell script. * testsuite/script_test_15a.t: New linker script. * testsuite/script_test_15b.sh: New shell script. * testsuite/script_test_15b.t: New linker script. * testsuite/script_test_15c.sh: New shell script. * testsuite/script_test_15c.t: New linker script.
2016-12-11Regenerate Makefile.in to get rid of annoying diffs caused by ↵Cary Coutant2-1/+5
non-deterministic automake. * Makefile.in: Regenerate.
2016-12-08[GOLD] Don't assert in powerpc stub_tableAlan Modra2-2/+7
A branch in a non-exec section that needs a stub can lead to this assertion. * powerpc.cc (Powerpc_relobj::stub_table): Return NULL rather then asserting.
2016-12-08[GOLD] fix typo in --stub-group-multi helpAlan Modra2-1/+5
* options.h (--stub-group-multi): Fix typo.
2016-12-07[GOLD] PowerPC --stub-group-multiAlan Modra3-19/+42
Adds a new option, defaulting to off, that allows a group of stubs to serve multiple output sections. Prior to this patch powerpc gold allowed this unconditionally, which is a little unsafe with clever code that discards/reuses sections at runtime. * options.h (--stub-group-multi): New PowerPC option. * powerpc.cc (Stub_control): Add multi_os_ var and param to constructor. Sort start_ var later. Comment State. (Stub_control::can_add_to_stub_group): Heed multi_os_. (Target_powerpc::group_sections): Update.
2016-12-07[GOLD] powerpc64le-linux fails to link large Linux kernelAlan Modra3-78/+64
Gold attaches stubs to an existing section in contrast to ld.bfd which inserts a new section for stubs. If we want stubs before branches, then the stubs must be added to the previous section. Adding to the previous section is a disaster if there is a large gap between the previous section and the group. PR gold/20878 * powerpc.cc (Stub_control): Replace stubs_always_before_branch_ with stubs_always_after_branch_, group_end_addr_ with group_start_addr_. (Stub_control::can_add_to_stub_group): Rewrite to suit scanning sections by increasing address. (Target_powerpc::group_sections): Scan that way. Delete corner case. * options.h (--stub-group-size): Update help string.
2016-12-07[GOLD] PowerPC stub debugAlan Modra2-11/+34
Some more debug output, and a little hardening. * powerpc.cc (Stub_table_owner): Provide constructor. (Powerpc_relobj::set_stub_table): Resize fill with -1. (Target_powerpc::Branch_info::make_stub): Provide target debug output on returning false.
2016-12-06Fix gold/testsuite/file_in_many_sections_test.sh file modeAlan Modra1-0/+0
chmod a+x
2016-12-05Fix problem where absolute local symbols are omitted when output has many ↵Cary Coutant6-11/+109
sections. 2016-12-05 Cary Coutant <ccoutant@gmail.com> Tristan Gingold <gingold@adacore.com> gold/ * object.cc (Sized_relobj_file::do_count_local_symbols): Check is_ordinary before using shndx. * testsuite/Makefile.am (file_in_many_sections_test.sh): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/file_in_many_sections.c: New source file. * testsuite/file_in_many_sections_test.sh: New script.
2016-12-01Fix problem where orphan section is treated as a KEEP section.Cary Coutant2-0/+7
gold/ PR gold/20717 * script-sections.cc (Script_sections): Set *keep to false when no match.
2016-12-01Fix problem causing internal error when -z max-page-size is used.Cary Coutant2-1/+17
If the default starting address is less than the new ABI page size, we end up misaligning the file header, causing an internal error. gold/ PR gold/20834 * target.h (Target::default_text_segment_address): Bump default start address up to ABI page size.
2016-12-01Implement --push-state/--pop-state.Cary Coutant3-1/+80
gold/ PR gold/18989 * options.cc (General_options::object_format_to_string): New function. (General_options::copy_from_posdep_options): New function. (General_options::parse_push_state): New function. (General_options::parse_pop_state): New function. * options.h (--push-state, --pop-state): New options. (General_options::object_format_to_string): New method. (General_options::set_incremental_disposition): New method. (General_options::copy_from_posdep_options): New method. (General_options::options_stack_): New data member.
2016-12-01Fix internal error when relaxing branches to STT_SECTION symbols.Cary Coutant4-0/+14
gold/ PR gold/20807 * aarch64.cc (Target_aarch64::scan_reloc_section_for_stubs): Handle section symbols correctly. * arm.cc (Target_arm): Likewise. * powerpc.cc (Target_powerpc): Likewise.
2016-11-27Fix spelling in comments in .def files (gold)Ambrogino Modigliani2-1/+5
* aarch64-reloc.def: Fix spelling in comments.
2016-11-27Fix spelling in comments in C source files (gold)Ambrogino Modigliani13-16/+31
* aarch64.cc: Fix spelling in comments. * arm.cc: Fix spelling in comments. * icf.cc: Fix spelling in comments. * layout.cc: Fix spelling in comments. * layout.h: Fix spelling in comments. * mips.cc: Fix spelling in comments. * output.h: Fix spelling in comments. * plugin.h: Fix spelling in comments. * script-sections.h: Fix spelling in comments. * script.h: Fix spelling in comments. * stringpool.h: Fix spelling in comments. * tilegx.cc: Fix spelling in comments.
2016-11-22Print the default for all binary options; clean up --help output.Cary Coutant3-216/+327
gold/ PR gold/20346 * options.cc (One_option::print): Print "(default)" when appropriate. * options.h: Clean up and re-sort options. (One_option::is_default): New data member. (One_option::One_option): Add is_default parameter; adjust all calls. (DEFINE_var): Add is_default__ parameter; adjust all calls. (DEFINE_bool): Set is_default based on default_value__. (DEFINE_bool_ignore): New macro. (--no-eh-frame-hdr): New option. (--enable-new-dtags): Remove mention of DT_FLAGS.
2016-11-22Fix spelling mistakes in comments in configure scriptsAmbrogino Modigliani2-1/+5
All changes are limited to comments, and no run-time behavior is affected. bfd/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * warning.m4: Fix spelling in comments. * configure.ac: Fix spelling in comments. * configure: Regenerate. binutils/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. gdb/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure.ac: Fix spelling in comments. * configure: Regenerate. gas/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. gold/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. gprof/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. ld/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate. opcodes/ChangeLog: 2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com> * configure: Regenerate.
2016-11-21Fix bug where -u option with empty archive results in internal error.Cary Coutant2-8/+13
gold/ PR gold/20693 * gold.cc (queue_middle_tasks): Force valid target earlier.
2016-11-21Add --build-id=uuid support for MinGW32.Igor Kudrin2-0/+30
2016-11-21 Igor Kudrin <ikudrin@accesssoftek.com> gold/ * layout.cc: Include windows.h and rpcdce.h (for MinGW32). (Layout::create_build_id): Generate uuid using UuidCreate().
2016-11-07Add missing '$' in configure.ac.Loïc Yhuel3-2/+7
2016-11-04 Loïc Yhuel <loic.yhuel@softathome.com> gold/ * configure.ac: add missing '$'. * configure: Regenerate.
2016-10-21Fix PR 17704.Gergely Nagy5-117/+219
This fix keeps the section with the highest alignment when folding sections with ICF. PR gold/17704 * icf.cc (match_sections): Add new parameter section_addraligns. Check section alignment and keep the section with the strictest alignment. (find_identical_sections): New local variable section_addraligns. Store each section's alignment. * testsuite/pr17704a_test.s: New file. * testsuite/Makefile.am (pr17704a_test): New test. * testsuite/Makefile.in: Regenerate.
2016-10-06[GOLD] two more fall-through commentsAlan Modra3-4/+9
* powerpc.cc (Target_powerpc::Relocate::relocate): Add fall through comment. * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2016-10-06[GOLD] -Wimplicit-fallthrough warning fixesAlan Modra10-18/+47
* aarch64.cc: Spell fall through comments as "// Fall through.". * arm.cc: Likewise. * mips.cc: Likewise. * powerpc.cc: Likewise. * s390.cc: Likewise. * sparc.cc: Likewise. * x86_64.cc: Likewise. * powerpc.cc (Target_powerpc::Relocate::relocate): Add missing fall through comments. * sparc.cc: (Target_sparc::Scan::global): Likewise. (Target_sparc::Relocate::relocate): Likewise. * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise. * resolve.cc (symbol_to_bits): Add missing break.
2016-09-27Don't treat as separate symbols if unversioned symbol is undefined.Cary Coutant2-0/+7
When we see an unversioned symbol reference in a shared library, followed by a default definition of the symbol in another shared library, we were treating them as separate symbols. That should only happen when both are definitions. gold/ PR gold/20238 * symtab.cc (Symbol_table::define_default_version): Check that unversioned symbol is defined.
2016-09-26When building target binaries, ensure that the warning flags selected for ↵Vlad Zakharov4-6/+58
the command line match the target compiler. bfd * warning.m4 (AC_EGREP_CPP_FOR_BUILD): Introduce macro to verify CC_FOR_BUILD compiler. (AM_BINUTILS_WARNINGS): Introduce ac_cpp_for_build variable and add CC_FOR_BUILD compiler checks. * Makefile.in: Regenerate. * configure: Likewise. * doc/Makefile.in: Likewise. binutils * Makefile.am: Replace AM_CLFAGS with AM_CFLAGS_FOR_BUILD when building with CC_FOR_BUILD compiler. * Makefile.in: Regenerate. * configure: Likewise. * doc/Makefile.in: Likewise. gas * Makefile.in: Regenerate. * configure: Likewise. * doc/Makefile.in: Likewise. gold * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise. gprof * Makefile.in: Regenerate. * configure: Likewise. ld * Makefile.in: Regenerate. * configure: Likewise. opcodes * Makefile.in: Regenerate. * configure: Likewise.
2016-09-26[GOLD] regen testsuite/Makefile.inAlan Modra2-5/+6
2016-09-26[GOLD] warning fixesAlan Modra3-2/+8
* aarch64.cc (Target_aarch64::is_erratum_835769_sequence): Avoid compiler warning. * output.cc (Output_segment::set_section_addresses): Likewise.
2016-09-02Handle ARM-specific --target1-abs, --target1-rel and --target2 optionsDoug Kwan12-16/+484
2016-08-31[GOLD] Further tidy to powerpc can_add_to_stub_groupAlan Modra2-19/+27
This patch adds a little more debug output, and replaces two variables with one, tracking current max group size by group_size_ rather than by has14_. * powerpc.cc (class Stub_control): Delete stub14_group_size_ and has14_. Add group_size_. (Stub_control::can_add_to_stub_group): Adjust to suit. Print debug info when switching to adding sections before stubs.
2016-08-31[GOLD] Add debug output for powerpc section groupingAlan Modra3-3/+21
* debug.h (DEBUG_TARGET): New. (DEBUG_ALL): Add DEBUG_TARGET. (gold_debug): Delete FORMAT param. * powerpc.cc (Stub_control::can_add_to_stub_group): Print debug ourput.
2016-08-30[GOLD] correct grouping of stubsAlan Modra2-33/+81
This patch rewrites the rather obscure can_add_to_stub_group, fixing a problem with the handling of sections containing conditional external branches. When a section group contains any such section, the group size needs to be limited to a much smaller size than groups with only non-conditional external branches. PR 20523 * powerpc.cc (class Stub_control): Add has14_. Comment owner_. (Stub_control::can_add_to_stub_group): Correct grouping of sections containing 14-bit external branches. When returning false, set state_ to reflect the fact that we have one section for the next group. Rewrite most of function for clarity. Add and expand comments. (Target_powerpc::do_relax): Print stub group size retry in hex.
2016-08-28PR gold/20529 - relaxing loop never ends.Han Shen2-3/+35
gold/ChangeLog 2016-08-26 Han Shen <shenhan@google.com> * powerpc.cc (Stub_table::min_size_threshold_): New member to limit size. (Stub_table::set_min_size_threshold): New member function. (Stub_table::set_address_and_size): Add code to only allow size increase. (Target_powerpc::do_relax): Add code to record last size.
2016-08-23[gold] Implement -z stack-size optionRoland McGrath5-19/+49
gold/ * options.h (General_options): Grok -z stack-size. * output.h (Output_segment::set_size): New method. * layout.cc (Layout::create_executable_stack_info): Renamed to ... (Layout::create_stack_segment): ... this. Always create the segment if -z stack-size was used. (Layout::set_segment_offsets): Don't call ->set_offset on the PT_GNU_STACK segment.
2016-08-23Add --be8 option to gold.Bharathi Seshadri3-9/+134
gold/ * options.h (General_options): Add --be8 option. * arm.cc (Arm_relobj::do_relocate_sections): Add code to swap for be8. (Output_data_plt_arm_standard::do_fill_first_plt_entry): Likewise. (Output_data_plt_arm_short::do_fill_plt_entry): Likewise. (Output_data_plt_arm_long::do_fill_plt_entry): Likewise. (Target_arm::do_adjust_elf_header): Do EF_ARM_BE8 adjustment.
2016-08-17Fix extraneous complaints about missing expected TLS relocation (i386).Cary Coutant4-14/+25
Build the test objects with the in-tree assembler. Also fix some cascading error messages caused by not resetting the skip_call_tls_get_addr_ flag after printing the error. gold/ * i386.cc (Target_i386): Reset skip_call_tls_get_addr_ after printing error message. * testsuite/Makefile.am (pr20216a): Add missing dependencies. (pr20308a): Add -Bgcctestdir/ to compile rules. * testsuite/Makefile.in: Regenerate.
2016-08-12PR gold/20462: Fix bogus layout on ARM with linker script using PHDRS clauseRoland McGrath2-20/+27
gold/ PR gold/20462 * script-sections.cc (Script_sections::release_segments): Reset this->segments_created_.
2016-08-12[gold] Implement HIDDEN syntax in linker scriptsRoland McGrath3-1/+11
gold/ * yyscript.y (HIDDEN): New %token. (assignment): Handle HIDDEN(string = expr) syntax. * script.cc (script_keyword_parsecodes): Add HIDDEN.
2016-08-10Fix extraneous complaints about missing expected TLS relocation.Cary Coutant4-4/+16
With some versions of gas, the call to tls_get_addr uses a GOTPCREL relocation instead of a GOTPCRELX relocation. We should allow for that when skip_call_tls_get_addr_ is true. We should also build the test objects with the in-tree assembler. This patch also fixes some cascading error messages caused by not resetting the skip_call_tls_get_addr_ flag after printing the error. gold/ PR gold/20216 * x86_64.cc (Target_x86_64::Relocate::relocate): Add check for R_X86_64_GOTPCREL. Reset skip_call_tls_get_addr_ after printing error message. * testsuite/Makefile.am (pr20216_gd.o): Add -Bgcctestdir/. (pr20216_ld.o): Likewise. * testsuite/Makefile.in: Regenerate.
2016-08-10Fix potential crashes when Target::make_symbol() returns NULL.James Clarke2-4/+18
2016-08-10 James Clarke <jrtc27@jrtc27.com> gold/ PR gold/20443 * symtab.cc (Symbol_table::add_from_relobj): Handle NULL symbols, which will be present for STT_SPARC_REGISTER. (Symbol_table::add_from_pluginobj): Likewise. (Symbol_table::add_from_dynobj): Likewise. (Symbol_table::add_from_incrobj): Removed dead code.
2016-08-10Fix improper handling of R_SPARC_GOTDATA_OP_LOX10 relocation.James Clarke2-7/+13
The fall-through in Target_sparc::Relocate::relocate for R_SPARC_GOTDATA_OP_LOX10 is currently R_SPARC_GOT13, but should clearly be R_SPARC_GOT10. GCC has been seen to emit a sethi/xor rather than a sethi/or sequence to load a 32-bit immediate, but if R_SPARC_GOT13 is used then bits 10-12 get zeroed out as both the sethi and xor immediates contain them. gold/ PR gold/20442 * sparc.cc (Target_sparc::Relocate::relocate): R_SPARC_GOTDATA_OP_LOX10 should fall back on R_SPARC_GOT10, not R_SPARC_GOT13.
2016-08-10Add support for R_SPARC_32 relocation.James Clarke2-1/+7
gold/ PR gold/20441 * sparc.cc (Target_sparc::Scan::check_non_pic): Allow R_SPARC_32 on sparc64.
2016-07-27Fix aarch64_relocs.sh file modeAlan Modra1-0/+0
2016-07-26[Gold, aarch64] Implement some AArch64 relocs.Han Shen8-9/+300
This CL implemented the following relocs for AArch64 target. - R_AARCH64_MOVW_UABS_G* - R_AARCH64_MOVW_SABS_G* relocations gold/ChangeLog 2016-07-26 Igor Kudrin <ikudrin@accesssoftek.com> * aarch64-reloc-property.cc (Rvalue_bit_select_impl): New class. (rvalue_bit_select): Use Rvalue_bit_select_impl. * aarch64-reloc.def (MOVW_UABS_G0, MOVW_UABS_G0_NC, MOVW_UABS_G1, MOVW_UABS_G1_NC, MOVW_UABS_G2, MOVW_UABS_G2_NC, MOVW_UABS_G3, MOVW_SABS_G0, MOVW_SABS_G1, MOVW_SABS_G2): New relocations. * aarch64.cc (Target_aarch64::Scan::local): Add cases for new MOVW_UABS_* and MOVW_SABS_* relocations. (Target_aarch64::Scan::global): Likewise. (Target_aarch64::Relocate::relocate): Add cases and handlings for new MOVW_UABS_* and MOVW_SABS_* relocations. * testsuite/Makefile.am (aarch64_relocs): New test. * testsuite/Makefile.in: Regenerate. * testsuite/aarch64_globals.s: New test source file. * testsuite/aarch64_relocs.s: Likewise. * testsuite/aarch64_relocs.sh: New test script.
2016-06-29Fix gold testsuite failure with GCC 6.Cary Coutant2-1/+6
With GCC 6 when not using -static-libstdc++, the operator delete(void*) function is defined in the shared C++ support library, rather than in the main program. The test script is too aggressive in checking for this symbol's presence among the exported symbols. This patch removes the check for that symbol. gold/ PR gold/20310 * testsuite/dynamic_list.sh: Remove check for _ZdlPv.
2016-06-29Update "make clean" in gold/testsuite.Cary Coutant3-2/+7
gold/ * testsuite/Makefile.am (MOSTLYCLEANFILES): Add eh_test_2. * testsuite/Makefile.in: Regenerate.
2016-06-30[GOLD] Pass -Wl,-z to gcc, not plain -zAlan Modra3-4/+10
* testsuite/Makefile.am (memory_test, memory_test_2): Pass -Wl,-z to gcc, not plain -z. * testsuite/Makefile.in: Regenerate.
2016-06-29gold: Support 386 TLS code sequences without PLTH.J. Lu8-126/+663
There are extensions to 386 psABI: https://groups.google.com/forum/#!topic/ia32-abi/awsRSvJOJfs to call tls_get_addr via GOT: call *___tls_get_addr@GOT(%reg) where EBX register isn't required as GOT base. Since direct call is 4-byte long and indirect call, is 5-byte long, the extra one byte must be handled properly. For general dynamic model, 7-byte lea instruction before call instruction is replaced by 6-byte one to make room for indirect call. For local dynamic model, we simply use 5-byte indirect call. TLS linker optimization is updated to recognize new instruction patterns. For local dynamic model to local exec model transition, we generate a 6-byte lea instruction as nop, instead of a 1-byte nop plus a 4-byte lea instruction. PR gold/20308 * i386.cc (Target_i386::Relocate::relocate): Allow R_386_GOT32X relocation against ___tls_get_addr. (Target_i386::Relocate::tls_gd_to_ie): Support indirect call to __tls_get_addr. (Target_i386::Relocate::tls_gd_to_le): Likewise. (Target_i386::Relocate::tls_ld_to_le): Likewise. * testsuite/Makefile.am (check_PROGRAMS): Add pr20308a_test, pr20308b_test, pr20308c_test, pr20308d_test, pr20308e_test. (pr20308a_test_SOURCES): New. (pr20308a_test_DEPENDENCIES): Likewise. (pr20308a_test_CFLAGS): Likewise. (pr20308a_test_LDFLAGS): Likewise. (pr20308a_test_LDADD): Likewise. (pr20308b_test_SOURCES): Likewise. (pr20308b_test_DEPENDENCIES): Likewise. (pr20308b_test_CFLAGS): Likewise. (pr20308b_test_LDFLAGS): Likewise. (pr20308b_test_LDADD): Likewise. (pr20308c_test_SOURCES): Likewise. (pr20308c_test_DEPENDENCIES): Likewise. (pr20308c_test_CFLAGS): Likewise. (pr20308c_test_LDFLAGS): Likewise. (pr20308c_test_LDADD): Likewise. (pr20308d_test_SOURCES): Likewise. (pr20308d_test_DEPENDENCIES): Likewise. (pr20308d_test_CFLAGS): Likewise. (pr20308d_test_LDFLAGS): Likewise. (pr20308d_test_LDADD): Likewise. (pr20308e_test_SOURCES): Likewise. (pr20308e_test_DEPENDENCIES): Likewise. (pr20308e_test_CFLAGS): Likewise. (pr20308e_test_LDFLAGS): Likewise. (pr20308e_test_LDADD): Likewise. (pr20308a.so): Likewise. (pr20308b.so): Likewise. (pr20308_gd.o): Likewise. (pr20308_ld.o): Likewise. (MOSTLYCLEANFILES): Add pr20308a.so pr20308b.so. * testsuite/Makefile.in: Regenerated. * testsuite/pr20308_def.c: New file. * testsuite/pr20308_gd.S: Likewise. * testsuite/pr20308_ld.S: Likewise. * testsuite/pr20308_main.c: Likewise.