Commit Graph

3966 Commits

Author SHA1 Message Date
Maciej W. Rozycki 1cb83cac9a MIPS/BFD: Fix TLS relocation resolution for regular executables
Correct an issue with commit 0f20cc3522 ("TLS support for MIPS"),
<https://sourceware.org/ml/binutils/2005-02/msg00607.html>, where a
condition used to determine whether to use a dynamic symbol for GD, LD
and IE TLS dynamic relocations against a symbol that has been defined
locally has been incorrectly reversed.

It's executables rather than dynamic shared objects where no symbol is
required, because such symbols cannot be preempted and therefore their
values (thread pointer offsets) are fixed at the static link time as is
the associated module ID of the main executable, so the original
condition should have been `shared' instead of `!shared'.  This wrong
condition was then later converted from `!shared' to `!bfd_link_pic',
with commit 0e1862bb40 ("Add output_type to bfd_link_info").

Use the correct `bfd_link_dll' condition then, and adjust code for the
dynamic symbol index possibly being -1 as with symbols that have been
forced local, removing unnecessary dynamic relocations from dynamic
regular executables.  PIE executables are unaffected as the existing
condition excluded them by chance due to the conversion mentioned above.

Adjust test cases accordingly.

	bfd/
	* elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
	than `!bfd_link_pic' in determining the dynamic symbol index.
	Avoid the index of -1.
	(mips_elf_initialize_tls_slots): Likewise.  Flatten code by
	moving `dyn' to the beginning of the function block.

	ld/
	* testsuite/ld-mips-elf/tlsdyn-o32.d: Update test for dynamic
	relocation removal.
	* testsuite/ld-mips-elf/tlsdyn-o32.got: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-1.d: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-1.got: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-2.d: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-2.got: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-3.d: Likewise.
	* testsuite/ld-mips-elf/tlsdyn-o32-3.got: Likewise.
2018-07-11 17:44:45 +01:00
Maciej W. Rozycki 9143e72c6d PR ld/22570: MIPS/BFD: Fix TLS relocation resolution for PIE executables
Correct a commit 0e1862bb40 ("Add output_type to bfd_link_info") issue
and use `bfd_link_dll' rather than `bfd_link_pic' in determining whether
to fully resolve GD, LD and IE TLS relocations referring to symbols
locally defined rather than deferring them to the load time by means of
dynamic relocations.

Such symbols cannot be preempted in PIE executables, which are
necessarily PIC, and therefore their values (thread pointer offsets) are
fixed at the static link time as is the associated module ID of the main
executable.

Given the `tlsbin-o32.s' and `tlsdyn-o32.s' sources from our test suite
this removes the absolute TLS relocations from the static:

DYNAMIC RELOCATION RECORDS
OFFSET   TYPE              VALUE
00000000 R_MIPS_NONE       *ABS*
1000002c R_MIPS_TLS_TPREL32  *ABS*
10000030 R_MIPS_TLS_DTPMOD32  *ABS*
10000038 R_MIPS_TLS_DTPMOD32  *ABS*

and the dynamic:

DYNAMIC RELOCATION RECORDS
OFFSET   TYPE              VALUE
00000000 R_MIPS_NONE       *ABS*
1000002c R_MIPS_TLS_TPREL32  *ABS*
10000038 R_MIPS_TLS_DTPMOD32  *ABS*
10000044 R_MIPS_TLS_DTPMOD32  *ABS*
10000030 R_MIPS_TLS_DTPMOD32  tlsvar_gd
10000034 R_MIPS_TLS_DTPREL32  tlsvar_gd
10000040 R_MIPS_TLS_TPREL32  tlsvar_ie

PIE executable respectively, as reported by `objdump -R', and fills the
corresponding GOT slots with the values expected, as recorded with the
test cases added.  The new output from `objdump -R' is:

DYNAMIC RELOCATION RECORDS (none)

and:

DYNAMIC RELOCATION RECORDS
OFFSET   TYPE              VALUE
00000000 R_MIPS_NONE       *ABS*
10000030 R_MIPS_TLS_DTPMOD32  tlsvar_gd
10000034 R_MIPS_TLS_DTPREL32  tlsvar_gd
10000040 R_MIPS_TLS_TPREL32  tlsvar_ie

for the static and the dynamic executable respectively.

2018-07-11  Maciej W. Rozycki  <macro@mips.com>
            Rich Felker  <bugdal@aerifal.cx>

	bfd/
	PR ld/22570
	* elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
	than `bfd_link_pic' to determine whether dynamic relocations are
	to be produced.
	(mips_elf_initialize_tls_slots): Likewise.

	ld/
	PR ld/22570
	* testsuite/ld-mips-elf/tlsbin-pie-o32.d: New test.
	* testsuite/ld-mips-elf/tlsbin-pie-o32.got: New test.
	* testsuite/ld-mips-elf/tlsdyn-pie-o32.d: New test.
	* testsuite/ld-mips-elf/tlsdyn-pie-o32.got: New test.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2018-07-11 17:44:45 +01:00
Alan Modra c7df3df443 Revise "ld testsuite use of notarget"
git commit 624940689a wrongly changed fill.d and fill16.d notarget
entries to xfail, so revert that change and instead replace notarget
with skip.  The two tests are complementary.

This patch also modifies the pr20022 test to use .data, avoiding
xfails on targets that complain about dynamic relocations in .text.
This shows a bug in metag which discards section _foo in pr2022.so.

	* testsuite/ld-elf/hash.d: Comment on mips xfail.
	* testsuite/ld-gc/pr20022b.s: Use .data not .text.
	* testsuite/ld-gc/pr20022.d: Remove xfails.
	* testsuite/ld-scripts/fill.d: Revert most of last patch, but use
	skip rather than notarget.
	* testsuite/ld-scripts/fill16.d: Likewise.
2018-07-11 16:39:04 +09:30
Maciej W. Rozycki 500c05ddbe MIPS/ld/testsuite: Limit export class call reloc tests to DSO targets
Only run MIPS/LD export class call relocation tests with shared library
targets, avoiding:

.../ld/ld-new: -shared not supported

linker errors and removing:

FAIL: MIPS export class call relocation test (o32)

regressions with `mipsel-ps2-elf' and `mips64el-ps2-elf' targets.

	ld/
	* testsuite/ld-mips-elf/mips-elf.exp: Limit export class call
	relocation tests to shared library targets.
2018-07-11 00:57:36 +01:00
Alan Modra be570f0684 xgate testsuite fixes
binutils/
	* testsuite/lib/binutils-common.exp (supports_gnu_unique): Return
	zero for xgate.
ld/
	* testsuite/lib/ld-lib.exp (check_gc_sections_available): Return 0
	for xgate.
	* testsuite/ld-elf/elf.exp: Add xgate to pr21703 xfails.
	* testsuite/ld-elf/shared.exp: Add xgate to pr21703 xfails.
	* testsuite/ld-discard/extern.d: xfail xgate.
	* testsuite/ld-discard/start.d: Likewise.
	* testsuite/ld-discard/static.d: Likewise.
	* testsuite/ld-elf/attributes.d: Likewise.
	* testsuite/ld-elf/compressed1d.d: Likewise.
	* testsuite/ld-elf/group1.d: Likewise.
	* testsuite/ld-elf/group3b.d: Likewise.
	* testsuite/ld-elf/group8a.d: Likewise.
	* testsuite/ld-elf/group8b.d: Likewise.
	* testsuite/ld-elf/group9a.d: Likewise.
	* testsuite/ld-elf/group9b.d: Likewise.
	* testsuite/ld-elf/linkonce2.d: Likewise.
	* testsuite/ld-elf/merge.d: Likewise.
	* testsuite/ld-elf/merge2.d: Likewise.
	* testsuite/ld-elf/merge3.d: Likewise.
	* testsuite/ld-elf/orphan-10.d: Likewise.
	* testsuite/ld-elf/orphan-9.d: Likewise.
	* testsuite/ld-elf/orphan-region.d: Likewise.
	* testsuite/ld-elf/orphan.d: Likewise.
	* testsuite/ld-elf/orphan3.d: Likewise.
	* testsuite/ld-elf/pr12851.d: Likewise.
	* testsuite/ld-elf/pr12975.d: Likewise.
	* testsuite/ld-elf/pr13177.d: Likewise.
	* testsuite/ld-elf/pr13195.d: Likewise.
	* testsuite/ld-elf/pr14156b.d: Likewise.
	* testsuite/ld-elf/pr17550c.d: Likewise.
	* testsuite/ld-elf/pr17550d.d: Likewise.
	* testsuite/ld-elf/pr17615.d: Likewise.
	* testsuite/ld-elf/pr20528a.d: Likewise.
	* testsuite/ld-elf/pr20528b.d: Likewise.
	* testsuite/ld-elf/pr21562a.d: Likewise.
	* testsuite/ld-elf/pr21562b.d: Likewise.
	* testsuite/ld-elf/pr21562c.d: Likewise.
	* testsuite/ld-elf/pr21562d.d: Likewise.
	* testsuite/ld-elf/pr21562i.d: Likewise.
	* testsuite/ld-elf/pr21562j.d: Likewise.
	* testsuite/ld-elf/pr21562k.d: Likewise.
	* testsuite/ld-elf/pr21562l.d: Likewise.
	* testsuite/ld-elf/pr21562m.d: Likewise.
	* testsuite/ld-elf/pr21562n.d: Likewise.
	* testsuite/ld-elf/pr22677.d: Likewise.
	* testsuite/ld-elf/pr22836-1a.d: Likewise.
	* testsuite/ld-elf/pr22836-1b.d: Likewise.
	* testsuite/ld-elf/pr349.d: Likewise.
	* testsuite/ld-elf/warn1.d: Likewise.
	* testsuite/ld-elf/warn2.d: Likewise.
	* testsuite/ld-elf/warn3.d: Likewise.
2018-07-10 23:59:59 +09:30
Alan Modra 1594e052d4 xgate cleanup
elf32-xgate.c contains many functions that are only stubs and
elf32-xgate.h contains unused declarations.  While this might be
reasonable for the initial commit of a port with subsequent work
fleshing out the stubs, xgate has only had two minor target specific
patches since the initial commit over six years ago.  The rest of the
changes have been general maintenance work applied to all ELF targets,
and some of this work could have been avoided if the stubs hadn't been
there.  So this patch removes all the stubs.

I've kept the functionality of the old elf32_xgate_add_symbol_hook,
implemented in elf32_xgate_backend_symbol_processing.  Presumably,
that's to set the symbol st_target_internal flag for use in
elf32-m68hc1x.c:elf32_m68hc11_relocate_section.

The empty elf32_xgate_relocate_section meant that xgate had no linker.
Or at least, no linker relocation processing.  Deleting the
elf_backend_relocate_section define means the target will now use the
generic linker reloc processing.  How good that is will depend on the
accuracy of the reloc howtos..

I haven't updated the ld testsuite to xfail tests expected to fail
for generic elf targets.

bfd/
	* elf32-xgate.h: Delete.
	* elf32-xgate.c: Delete unnecessary forward declarations, add two
	that are now needed.
	(xgate_elf_bfd_link_hash_table_create)
	(xgate_elf_bfd_link_hash_table_free)
	(xgate_elf_set_mach_from_flags, struct xgate_scan_param)
	(stub_hash_newfunc, elf32_xgate_add_symbol_hook)
	(elf32_xgate_setup_section_lists, elf32_xgate_size_stubs)
	(elf32_xgate_build_stubs, elf32_xgate_check_relocs)
	(elf32_xgate_relocate_section, _bfd_xgate_elf_set_private_flags)
	(elf32_xgate_post_process_headers): Delete.
	(elf32_xgate_backend_symbol_processing): New function.
	(xgate_elf_ignore_reloc, xgate_elf_special_reloc)
	(_bfd_xgate_elf_print_private_bfd_data): Make static.
	(ELF_TARGET_ID, elf_info_to_howto, elf_backend_check_relocs)
	(elf_backend_relocate_section, elf_backend_object_p)
	(elf_backend_final_write_processing, elf_backend_can_gc_sections)
	(elf_backend_post_process_headers, elf_backend_add_symbol_hook)
	(bfd_elf32_bfd_link_hash_table_create)
	(bfd_elf32_bfd_set_private_flags)
	(xgate_stub_hash_lookup): Don't define.
	(elf_backend_symbol_processing): Define.
	* elf-bfd.h (elf_target_id): Delete XGATE_ELF_DATA.
ld/
	* emulparams/xgateelf.sh (TEMPLATE_NAME) Set to generic.
	(EXTRA_EM_FILE): Set to genelf.
2018-07-10 23:59:07 +09:30
Alan Modra 624940689a ld testsuite use of notarget
Much of the time it is better to use xfail rather than notarget to
hide a testsuite failure no one is planning on fixing.

1) When a target is fixed, an inappropriate xfail results in XPASS
   whereas notarget is silent.  Leaving in an inappropriate notarget
   entry risks the bug reappearing later, silently.
2) Tests might be used as a template for a new test, carrying over
   notarget and/or xfail.  Inappropriate notarget entries are silent.
3) An xfailed test that mysteriously XPASSes might actually indicate a
   bug.

	* testsuite/ld-elf/attributes.d: Use xfail rather than notarget.
	* testsuite/ld-elf/hash.d: Likewise.
	* testsuite/ld-elf/orphan-10.d: Likewise.
	* testsuite/ld-elf/overlay.d: Likewise.
	* testsuite/ld-elf/pr14926.d: Likewise.
	* testsuite/ld-elf/pr17550d.d: Likewise.
	* testsuite/ld-elf/pr19539.d: Likewise.
	* testsuite/ld-elf/pr22319.d: Likewise.
	* testsuite/ld-misc/defsym1.d: Likewise.
	* testsuite/ld-pe/pr19803.d: Likewise.
	* testsuite/ld-scripts/assign-loc.d: Likewise.
	* testsuite/ld-scripts/defined4.d: Likewise.
	* testsuite/ld-scripts/empty-address-1.d: Likewise.
	* testsuite/ld-scripts/empty-address-2a.d: Likewise.
	* testsuite/ld-scripts/empty-address-2b.d: Likewise.
	* testsuite/ld-scripts/fill.d: Likewise.
	* testsuite/ld-scripts/fill16.d: Likewise.
	* testsuite/ld-scripts/pr14962.d: Likewise.
	* testsuite/ld-scripts/pr14962-2.d: Likewise.
	* testsuite/ld-unique/pr21529.d: Likewise.
	* testsuite/ld-elf/compress1a.d: Likewise, and adjust targets.
	* testsuite/ld-elf/compressed1a.d: Likewise.
	* testsuite/ld-elf/compressed1d.d: Likewise.
	* testsuite/ld-elf/compressed1e.d: Likewise.
	* testsuite/ld-elf/eh5.d: Likewise.
	* testsuite/ld-elf/group8a.d: Likewise.
	* testsuite/ld-elf/linkonce2.d: Likewise.
	* testsuite/ld-elf/orphan-9.d: Likewise.
	* testsuite/ld-elf/pr17550a.d: Likewise.
	* testsuite/ld-elf/pr17550b.d: Likewise.
	* testsuite/ld-elf/pr17550c.d: Likewise.
	* testsuite/ld-elf/pr19162.d: Likewise.
	* testsuite/ld-elf/pr21884.d: Likewise.
	* testsuite/ld-gc/pr19167.d: Likewise.
	* testsuite/ld-gc/pr20022.d: Likewise.
	* testsuite/ld-gc/start.d: Likewise.
	* testsuite/ld-elf/orphan-11.d: Delete notarget.
	* testsuite/ld-elf/orphan-12.d: Likewise.
	* testsuite/ld-gc/stop.d: Likewise.
	* testsuite/ld-scripts/empty-address-3a.d: Likewise.
	* testsuite/ld-scripts/empty-address-3b.d: Likewise.
	* testsuite/ld-ifunc/pr17154-x86-64-now.d: Delete duplicate notarget.
	* testsuite/ld-scripts/section-match-1.d: Comment fix.
2018-07-10 23:58:29 +09:30
Maciej W. Rozycki 7153abac62 MIPS/LD/testsuite: Make Linux dumps for n64 GOT relocation tests the default
The current default dumps for n64 GOT relocation tests only work for
IRIX targets really, while the Linux dumps are suitable for non-Linux
targets as well.  Make the Linux dumps the default then and handle the
IRIX ones as a special case.

Define an `irix' variable as a shorthand for `[istarget *-*-irix*]' and
use it for these n64 GOT relocation tests as well as export class call
relocation tests.

	ld/
	* testsuite/ld-mips-elf/elf-rel-got-n64.d: Rename to...
	* testsuite/ld-mips-elf/elf-rel-got-n64-irix.d: ... this.
	* testsuite/ld-mips-elf/elf-rel-got-n64-linux.d: Rename to...
	* testsuite/ld-mips-elf/elf-rel-got-n64.d: ... this.
	* testsuite/ld-mips-elf/elf-rel-xgot-n64.d: Rename to...
	* testsuite/ld-mips-elf/elf-rel-xgot-n64-irix.d: ... this.
	* testsuite/ld-mips-elf/elf-rel-xgot-n64-linux.dd: Rename to...
	* testsuite/ld-mips-elf/elf-rel-xgot-n64.d: ... this.
	* testsuite/ld-mips-elf/mips-elf.exp: Update accordingly.
	Define `irix' as a shorthand for `[istarget *-*-irix*]' and use
	it throughout.
2018-07-10 01:28:46 +01:00
Maciej W. Rozycki 8d4c0995eb MIPS/LD/testsuite: Fix IRIX dumps for n64 GOT relocation tests
Factor in the presence of a `.gnu.attributes' section at the end of the
respective dumps:

Disassembly of section .gnu.attributes:

0000000000000000 <.gnu.attributes>:
   0:	41000000 	bc0f	4 <__dso_displacement+0x4>
   4:	0f676e75 	jal	d9db9d4 <__dso_displacement+0xd9db9d4>
   8:	00010000 	sll	zero,at,0x0
   c:	00070401 	0x70401

and also ignore any trailing output with the IRIX variant of n64 GOT
relocation tests, like already done with the Linux and the embedded
ones, removing:

FAIL: MIPS ELF got reloc n64
FAIL: MIPS ELF xgot reloc n64

LD testsuite regressions with the `mips-sgi-irix6' target.

	ld/
	* testsuite/ld-mips-elf/elf-rel-got-n64.d: Add `#pass' at the
	end.
	* testsuite/ld-mips-elf/elf-rel-xgot-n64.d: Likewise.
2018-07-09 23:43:27 +01:00
Maciej W. Rozycki 4b8377e7db MIPS/BFD: Do not redirect to discarded lazy binding stubs
Correct a MIPS/BFD linker issue with dynamic symbol and corresponding
GOT entry values being redirected to lazy binding stubs where the stubs
section has been discarded by assigning to the `/DISCARD/' output
section in the linker script used.  The issue manifests itself by the
values entered being relative to the absolute section, which is what any
discarded sections are internally assigned in the linker.

For the `stub-dynsym-2.s' piece of code included as a test case with
this change this issue results in the dynamic symbol table and the GOT
looking like:

Symbol table '.dynsym' contains 3 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000010     0 FUNC    GLOBAL DEFAULT  UND bar
     2: 00000000     0 FUNC    GLOBAL DEFAULT  UND foo

Primary GOT:
 Canonical gp value: 00097ff0

 Reserved entries:
   Address     Access  Initial Purpose
  00090000 -32752(gp) 00000000 Lazy resolver
  00090004 -32748(gp) 80000000 Module pointer (GNU extension)

 Global entries:
   Address     Access  Initial Sym.Val. Type    Ndx Name
  00090008 -32744(gp) 00000010 00000010 FUNC    UND bar
  0009000c -32740(gp) 00000000 00000000 FUNC    UND foo

if assembled to regular MIPS code, or:

Symbol table '.dynsym' contains 3 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000d     0 FUNC    GLOBAL DEFAULT  UND bar
     2: 00000001     0 FUNC    GLOBAL DEFAULT  UND foo

Primary GOT:
 Canonical gp value: 00097ff0

 Reserved entries:
   Address     Access  Initial Purpose
  00090000 -32752(gp) 00000000 Lazy resolver
  00090004 -32748(gp) 80000000 Module pointer (GNU extension)

 Global entries:
   Address     Access  Initial Sym.Val. Type    Ndx Name
  00090008 -32744(gp) 0000000d 0000000d FUNC    UND bar
  0009000c -32740(gp) 00000001 00000001 FUNC    UND foo

if assembled to microMIPS code.  Symbol values and GOT entries record
the offset into the inexistent stubs section and the ISA bit rather than
zero, which would be the case if a lazy binding stub was not used for
other reasons, such as the value of the symbol being taken for a purpose
other than making a function call (e.g. an R_MIPS_GOT16 relocation).

Correct the issue by refraining from redirecting symbols to lazy binding
stubs if the stubs section is going to be discarded.

	bfd/
	* elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Don't set
	`->needs_lazy_stub' if the stubs output section is the absolute
	section.

	ld/
	* testsuite/ld-mips-elf/stub-dynsym-2.dd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-2.gd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-2.sd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-discard-2.gd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-discard-2.sd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-2.dd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-2.gd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-2.sd: New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-2.dd: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-2.gd: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-2.sd: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-2.ld: New test linker
	script.
	* testsuite/ld-mips-elf/stub-dynsym-discard-2.ld: New test
	linker script.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2018-07-09 21:30:44 +01:00
Maciej W. Rozycki 8a8c916960 LD/testsuite: run_dump_test: Report UNSUPPORTED for excluded targets
Bring the LD implementation of `run_dump_test' in line with its binutils
and GAS counterparts and report the UNSUPPORTED status for tests the run
of which has been prevented by means of one or more of `target',
`alltargets' and `notarget' tags.  Define `skip', `anyskip' and `noskip'
tags, which do not report anything for tests that are not run.

The rationale behind this is that we want to have unsupported tests
reported to ensure that they have actually been attempted and have not
been accidentally suppressed.  Then tests which have target-specific
variants that cannot be expressed with a single .d file can make use of
the newly added tags to silently suppress the uninteresting variants.

	ld/
	* testsuite/lib/ld-lib.exp (run_dump_test): Call `unsupported'
	if the target being tested has been excluded by means of one or
	more of `target', `alltargets' and `notarget' tags.  Add support
	for `skip', `anyskip' and `noskip' tags.
2018-07-09 15:50:57 +01:00
Maciej W. Rozycki 8f7fc65182 LD/testsuite: run_dump_test: Use the intended test name ASAP
Bring the LD implementation of `run_dump_test' in line with its binutils
and GAS counterparts and use the intended test name, from the `name' tag
if set, for test status reporting as soon as it is available.

	ld/
	* testsuite/lib/ld-lib.exp (run_dump_test): Move the setting of
	`testname' earlier on and use it for test status reporting.
2018-07-09 15:50:57 +01:00
Alan Modra 61658d78f0 m68hc1* fixes
With config.sub now properly returning m68hc12-unknown-elf rather than
m68hc12-unknown-none, more ELF tests run.  This patch enables
STB_GNU_UNIQUE processing fixing some testsuite failures that probably
no m68hc12 user cares about, and removes some XPASSes.

bfd/
	* elf32-m68hc1x.c (elf32_m68hc11_post_process_headers): Call
	_bfd_elf_post_process_headers.
ld/
	* testsuite/ld-discard/extern.d: Remove m68hc12 xfail.
	* testsuite/ld-discard/start.d: Likewise.
	* testsuite/ld-discard/static.d: Likewise.
2018-07-09 17:27:35 +09:30
Christophe Lyon f5a1cdde80 [ARM] Fix warning cannot find thumb start symbol
In case params.thumb_entry_symbol has its default NULL value, using it
to print a warning in gld${EMULATION_NAME}_finish results in a crash.

Use h->root.string instead which either points to
params.thumb_entry_symbol name or to entry_symbol name.

2018-07-09  Christophe Lyon  <christophe.lyon@linaro.org>

	* emultempl/armelf.em (gld${EMULATION_NAME}_finish): Use the right
	symbol name in case of warning.

Change-Id: Iec61a833c0ad538b1440bf326ba67834c314dd63
2018-07-09 07:47:24 +00:00
Jim Wilson bb11866d6a RISC-V: Add riscv-*-* configure support, and minor cleanup.
bfd/
	* config.bfd (riscv32*-*-*): Renamed from riscv32-*-*.
	(riscv64*-*-*): Likewise.
	(riscv-*-*): Add as an alias for riscv32*-*-*.

	ld/
	* configure.tgt (riscv-*-*): Add as an alias for riscv32*-*-*.
2018-07-05 17:49:11 -07:00
Maciej W. Rozycki a5628fa844 MIPS/LD/testsuite: Use $linux_gnu consistently across `mips-elf.exp'
Replace two remaining spelled-out calls to `[istarget mips*-*-linux*]'
in `mips-elf.exp' with $linux_gnu, which is equivalent.

	ld/
	* testsuite/ld-mips-elf/mips-elf.exp: Replace remaining calls to
	`[istarget mips*-*-linux*]' with $linux_gnu.
2018-07-05 19:44:02 +01:00
H.J. Lu 56ad703d56 x86: Remove x86 ISA properties with empty bits
There is no need to generate x86 ISA properties with empty bits in
linker output.

bfd/

	PR ld/23372
	* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86
	ISA properties with empty bits.

ld/

	PR ld/23372
	* testsuite/ld-i386/i386.exp: Run pr23372a and pr23372b.
	* testsuite/ld-i386/pr23372a.d: New file.
	* testsuite/ld-i386/pr23372a.s: Likewise.
	* testsuite/ld-i386/pr23372b.d: Likewise.
	* testsuite/ld-i386/pr23372b.s: Likewise.
	* testsuite/ld-i386/pr23372c.s: Likewise.
	* testsuite/ld-x86-64/pr23372a-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372a.d: Likewise.
	* testsuite/ld-x86-64/pr23372a.s: Likewise.
	* testsuite/ld-x86-64/pr23372b-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372b.d: Likewise.
	* testsuite/ld-x86-64/pr23372b.s: Likewise.
	* testsuite/ld-x86-64/pr23372c.s: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Run pr23372a, pr23372a-x32,
	pr23372b and pr23372b-x32.
2018-07-05 09:24:18 -07:00
Nick Clifton d8dab05495 Updated Russian, Bulgarian, and Brazilian Portuguese translations for various components of the binutuls.
ld	* po/bg.po: Updated Bulgarian translation.
	* po/pt_BR.po: Updated Brazilian Portuguese translation.

binutils* po/bg.po: Updated Bulgarian translation.

bfd,gas	* po/ru.po: Updated Russian translation.
2018-07-05 12:16:56 +01:00
Alan Modra 4a91d0ba30 Error for mismatched powerpc ABI tags
And report the two input files that are incompatible rather than
reporting that an input file is incompatible with the output.

bfd/
	* elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Update prototype.
	* elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): Return error
	on mismatch.  Remove "warning: " from messages.  Track last bfd
	used to set tags.
	(ppc_elf_merge_obj_attributes): Likewise.  Handle status from
	_bfd_elf_ppc_merge_fp_attributes.
	* elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Handle status
	from _bfd_elf_ppc_merge_fp_attributes.
ld/
	* testsuite/ld-powerpc/attr-gnu-4-12.d: Update expected output.
	* testsuite/ld-powerpc/attr-gnu-4-13.d: Likewise.
	* testsuite/ld-powerpc/attr-gnu-4-21.d: Likewise.
	* testsuite/ld-powerpc/attr-gnu-4-23.d: Likewise.
	* testsuite/ld-powerpc/attr-gnu-4-31.d: Likewise.
	* testsuite/ld-powerpc/attr-gnu-4-32.d: Likewise.
	* testsuite/ld-powerpc/attr-gnu-8-23.d: Likewise.
	* testsuite/ld-powerpc/attr-gnu-12-21.d: Likewise.
2018-07-05 10:21:37 +09:30
H.J. Lu 94d401b8b8 ld: Set non_ir_ref_regular for --undefined SYMBOL
Set non_ir_ref_regular to TRUE for symbols forced into the output file
so that they won't be removed by garbage collection with LTO.

	PR ld/23309
	* ldlang.c (insert_undefined): Set non_ir_ref_regular to TRUE.
	* plugin.c (is_visible_from_outside): Don't scan entry_symbol.
	* testsuite/ld-plugin/pr23309.c: New file.
	* testsuite/ld-plugin/pr23309.d: Likewise.
2018-07-04 06:29:13 -07:00
H.J. Lu b14b7ff14f ld: Properly display default for -z separate-code
Check DEFAULT_LD_Z_SEPARATE_CODE to display default for -z separate-code.

	PR ld/23358
	* lexsup.c (elf_shlib_list_options): Properly display default
	for -z separate-code.
2018-07-04 06:22:51 -07:00
Maciej W. Rozycki 30e5322741 MIPS/LD/testsuite: Fix a typo in PR ld/21334 test name
ld/
	* testsuite/ld-mips-elf/mips-elf.exp: Fix a typo in PR ld/21334
	test name.
2018-07-02 23:57:21 +01:00
H.J. Lu b638b5d57f x86-64: Clear the R_X86_64_converted_reloc_bit bit
We need to clear the R_X86_64_converted_reloc_bit bit after setting it
to avoid leaking it out by --emit-relocs.

bfd/

	PR ld/23324
	* elf64-x86-64.c (elf_x86_64_relocate_section): Clear the
	R_X86_64_converted_reloc_bit bit.

ld/

	PR ld/23324
	* testsuite/ld-x86-64/pr23324.s: New file.
	* testsuite/ld-x86-64/pr23324a.d: Likewise.
	* testsuite/ld-x86-64/pr23324b.d: Likewise.
2018-07-02 13:08:09 -07:00
Thomas Preud'homme c0c468d562 [ARM] Update bfd's Tag_CPU_arch knowledge
BFD's bfd_get_mach () function returns a bfd specific value representing
the architecture of the target which is populated from the Tag_CPU_arch
build attribute value of that target. Among other users of that
interfacem, objdump which uses it to print the architecture version of
the binary being examinated and to decide what instruction is available
if run with "-m arm" via its own mapping from bfd_mach_arm_X values to
feature bits available.

However, both BFD and objdump's most recent known architecture is
Armv5TE. When encountering a newer architecture bfd_get_mach will return
bfd_mach_arm_unknown. This is unfortunate since objdump uses that value
to allow all instructions on all architectures which is already what it
does by default, making the "-m arm" trick useless.

This patch updates BFD and objdump's knowledge of Arm architecture
versions up to the latest Armv8-M Baseline and Mainline, Armv8-R and
Armv8.4-A architectures. Since several architecture versions (eg. 8.X-A)
share the same Tag_CPU_arch build attribute value and
bfd_mach_arm values, the mapping from bfd machine value to feature bits
need to return the most featureful feature bits that would yield the
given bfd machine value otherwise some instruction would not disassemble
under "-m arm" mode. The patch rework that mapping to make this clearer
and simplify writing the mapping rules. In particular, for simplicity
all FPU instructions are allowed in all cases.

Finally, the patch also rewrite the cpu_arch_ver table in GAS to use the
TAG_CPU_ARCH_X macros rather than hardcode their value.

2018-07-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	* archures.c (bfd_mach_arm_5TEJ, bfd_mach_arm_6, bfd_mach_arm_6KZ,
	bfd_mach_arm_6T2, bfd_mach_arm_6K, bfd_mach_arm_7, bfd_mach_arm_6M,
	bfd_mach_arm_6SM, bfd_mach_arm_7EM, bfd_mach_arm_8, bfd_mach_arm_8R,
	bfd_mach_arm_8M_BASE, bfd_mach_arm_8M_MAIN): Define.
	* bfd-in2.h: Regenerate.
	* cpu-arm.c (arch_info_struct): Add entries for above new
	bfd_mach_arm values.
	* elf32-arm.c (bfd_arm_get_mach_from_attributes): Add Tag_CPU_arch to
	bfd_mach_arm mapping logic for pre Armv4 and Armv5TEJ and later
	architectures.  Force assert failure for any new Tag_CPU_arch value.

gas/
	* config/tc-arm.c (cpu_arch_ver): Use symbolic TAG_CPU_ARCH macros
	rather than hardcode their values.

ld/
	* arm-dis.c (select_arm_features): Fix typo in heading comment.  Allow
	all FPU features and add mapping from new bfd_mach_arm values to
	allowed CPU feature bits.

opcodes/
	* testsuite/ld-arm/tls-descrelax-be8.d: Add architecture version in
	expected result.
	* testsuite/ld-arm/tls-descrelax-v7.d: Likewise.
	* testsuite/ld-arm/tls-longplt-lib.d: Likewise.
	* testsuite/ld-arm/tls-longplt.d: Likewise.
2018-07-02 11:22:20 +01:00
Thomas Preud'homme a05a5b64cf Fix use of "command line X" in binutils doc
Binutils documentation uses a mix of spelling for the compound word
"command-line X". According to [1]:

"Sometimes compound words are written separately (nail polish),
sometimes with a hyphen (short-sighted) and sometimes as one word
(eyelashes). Often new compounds are written as two separate words and,
as they become more familiar, they are either connected with a hyphen
(-) or made into one word."

I think command-line X is common enough in our industry that the two
workds command and line should be connected. Since command-line is more
common than commandline, I propose to update binutils documentation to
consistently use "command-line" when this is used as an adjective to a
noun (eg. command-line argument, command-line switch, command-line
option and command-line flag). I've left occurences of "the command
line" as is. I've also left gdb, sim and readline alone and have only
touched public documentation (texi and NEWS files).

[1]
http://dictionary.cambridge.org/grammar/british-grammar/word-formation/compounds

2018-07-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
	* doc/bfdint.texi: Use command-line consistently when used in a
	compount word.
	* doc/bfdsumm.texi: Likewise.

binutils/
	* NEWS: Use command-line consistently when used in a compount word.
	* doc/binutils.texi: Likewise and fix trailing whitespace on same
	line.

gas/
	* NEWS: Use command-line consistently when used in a compount word.
	* doc/as.texi: Likewise.
	* doc/c-aarch64.texi: Likewise.
	* doc/c-alpha.texi: Likewise.
	* doc/c-arc.texi: Likewise.
	* doc/c-arm.texi: Likewise.
	* doc/c-avr.texi: Likewise.
	* doc/c-bfin.texi: Likewise.
	* doc/c-cris.texi: Likewise.
	* doc/c-epiphany.texi: Likewise.
	* doc/c-i386.texi: Likewise.
	* doc/c-ia64.texi: Likewise.
	* doc/c-lm32.texi: Likewise.
	* doc/c-m32r.texi: Likewise.
	* doc/c-m68k.texi: Likewise.
	* doc/c-mips.texi: Likewise.
	* doc/c-mmix.texi: Likewise.
	* doc/c-msp430.texi: Likewise.
	* doc/c-mt.texi: Likewise.
	* doc/c-nios2.texi: Likewise.
	* doc/c-ppc.texi: Likewise.
	* doc/c-pru.texi: Likewise.
	* doc/c-rl78.texi: Likewise.
	* doc/c-rx.texi: Likewise.
	* doc/c-tic6x.texi: Likewise.
	* doc/c-v850.texi: Likewise.
	* doc/c-vax.texi: Likewise.
	* doc/c-visium.texi: Likewise.
	* doc/c-xstormy16.texi: Likewise.
	* doc/c-xtensa.texi: Likewise.
	* doc/c-z80.texi: Likewise.
	* doc/c-z8k.texi: Likewise.
	* doc/internals.texi: Likewise.

gprof/
	* gprof.texi: Use command-line consistently when used in a compount
	word.

ld/
	* NEWS: Use command-line consistently when used in a compount word.
	* ld.texinfo: Likewise.
	* ldint.texinfo: Likewise.
2018-07-02 11:18:24 +01:00
Nick Clifton 30aa13067f Updated translations.
gas	* po/uk.po: Updated Ukranian translation.
bfd	* po/uk.po: Updated Ukranian translation.
ld	* po/uk.po: Updated Ukranian translation.
gold	* po/uk.po: Updated Ukranian translation.

opcodes	* po/uk.po: Updated Ukranian translation.
	* po/de.po: Updated German translation.
	* po/pt_BR.po: Updated Brazilian Portuguese translation.

binutils* po/sv.po: Updated Swedish translation.
	* po/uk.po: Updated Ukranian translation.
2018-06-26 14:03:16 +01:00
Alan Modra 2822b09ff6 PR23169 bogus test
The testcase isn't valid.  If it happens to run on your target, you're
lucky.

	PR 23169
	* testsuite/ld-ifunc/ifunc.exp: Don't run pr23169 tests on
	powerpc.  Comment.
2018-06-26 21:28:05 +09:30
Alan Modra 2db70efacd Fix parens in ld bootstrap.exp
Seen with tcl 8.5.13:
ERROR: tcl error sourcing .../ld/testsuite/ld-bootstrap/bootstrap.exp.
ERROR: expected boolean value but got " [istarget ia64-*-elf*] || [istarget ia64-*-linux*"
    while executing
"if { "$flags" == "--static" && { [istarget ia64-*-elf*] || [istarget ia64-*-linux*] }
	 || [istarget mips*-*-linux*] } {
	# On ia64 and mips, tmpdir/l..."

	* testsuite/ld-bootstrap/bootstrap.exp: Use parentheses rather
	than curly braces in logical expression.
2018-06-26 21:28:05 +09:30
Nick Clifton eca4b72146 Fix spelling mistakes.
opcodes	* nfp-dis.c: Fix spelling mistake.

ld	* emultempl/aarch64elf.em: Fix spelling mistake.
	* emultempl/avrelf.em: Likewise.
	* emultempl/elf32.em: Likewise.

binutils* doc/binutils.texi: Fix spelling mistakes.
	* README--how-to-make-a-release: Likewise.
2018-06-26 12:56:23 +01:00
Nick Clifton 71300e2c0c Regenerate configure and pot files with updated binutils version number. 2018-06-24 19:13:01 +01:00
Nick Clifton 719d828850 Add 2.30 branch notes to ChangeLogs and NEWS files. 2018-06-24 18:36:15 +01:00
Renlin Li b939d8a0de [BFD][AARCH64]Properly truncate no overflow checking relocation value for load/store immediate.
bfd/ChangeLog:

2018-06-20  Renlin Li  <renlin.li@arm.com>

	* elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Use PG_OFFSET
	to resolve BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.

ld/ChangeLog:

2018-06-20 Renlin Li  <renlin.li@arm.com>

	* testsuite/ld-aarch64/emit-relocs-115.d: Update test with new value.
	* testsuite/ld-aarch64/emit-relocs-534.d: Likewise.
	* testsuite/ld-aarch64/emit-relocs-555.d: Likewise.
2018-06-20 14:47:37 +01:00
Maciej W. Rozycki 789ff5b6c2 PR ld/22966: Fix n64 MIPS `.got.plt' range checks
The addressable signed 32-bit range for n64 MIPS `.got.plt' references
is from 0xffffffff7fff8000 to 0x7fff7fff, due to how the composition of
an LUI and an LD instruction works for address calculation in the 64-bit
addressing mode, such as when CP0.Status.UX=1.

We currently have a range check in `mips_finish_exec_plt', however it is
not correct as it verifies that the `.got.plt' start address referred is
between 0xffffffff80000000 and 0x7fffffff.  It is also implemented as an
assertion rather than a proper error message despite that the situation
can be triggered by user input.  Additionally there is no check made for
individual `.got.plt' entries referred even though they can be out of
range while the `.got.plt' start address is not.

Fix all these problems and use the correct range for the check, limiting
it to n64 output files, and then issue a proper error message both in
`mips_finish_exec_plt' and in `_bfd_mips_elf_finish_dynamic_symbol',
suggesting the use of the `-Ttext-segment=...' option that will often
work and with the default linker scripts in particular.  Add suitable
tests covering boundary cases.

	bfd/
	PR ld/22966
	* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Verify the
	`.got.plt' entry referred is in range.
	(mips_finish_exec_plt): Correct the range check for `.got.plt'
	start.  Replace the assertion used for that with a proper error
	message.

	ld/
	PR ld/22966
	* testsuite/ld-mips-elf/n64-plt-1.dd: New test.
	* testsuite/ld-mips-elf/n64-plt-1.gd: New test.
	* testsuite/ld-mips-elf/n64-plt-2.ed: New test.
	* testsuite/ld-mips-elf/n64-plt-3.ed: New test.
	* testsuite/ld-mips-elf/n64-plt-4.dd: New test.
	* testsuite/ld-mips-elf/n64-plt-4.gd: New test.
	* testsuite/ld-mips-elf/n64-plt-1.ld: New test linker script.
	* testsuite/ld-mips-elf/n64-plt-2.ld: New test linker script.
	* testsuite/ld-mips-elf/n64-plt-3.ld: New test linker script.
	* testsuite/ld-mips-elf/n64-plt-4.ld: New test linker script.
	* testsuite/ld-mips-elf/n64-plt.s: New test source.
	* testsuite/ld-mips-elf/n64-plt-lib.s: New test source.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2018-06-20 00:37:51 +01:00
Maciej W. Rozycki a4eb69274d MIPS/LD/testsuite: XFAIL DT_TEXTREL map file warning test
Remove:

FAIL: DT_TEXTREL map file warning

introduced with commit 63c1f59d66 ("readonly_dynrelocs"), coming from
the lack of a "dynamic relocation against `foo' in read-only section
`.rodata'" warning message produced.

The cause of the failure is that for sections which have dynamic
relocations attached the MIPS backend sets SHF_WRITE, in
`mips_elf_create_dynamic_relocation', yielding:

$ readelf -S textrel.so | grep rodata
  [ 8] .rodata           PROGBITS        00000254 000254 000004 00  WA  0   0  1
$

so the section is read/write and therefore there is nothing to warn
about.

This arrangement came from commit 7403cb6305 ("PATCH for N32 ABI"),
<https://sourceware.org/ml/binutils/1999-q2/msg00375.html>, i.e. for all
practical purposes it has been there since forever, and therefore it can
be considered a part of the ABI and the test case irrelevant for MIPS
targets.

We don't have a clean way to request UNSUPPORTED result, which would be
the most appropriate here, so just XFAIL the test instead.

	ld/
	* testsuite/ld-elf/shared.exp: XFAIL DT_TEXTREL map file warning
	test for `mips*-*-*'.
2018-06-20 00:37:51 +01:00
Simon Marchi d0ac1c4488 Bump to autoconf 2.69 and automake 1.15.1
When trying to run the update-gnulib.sh script in gdb, I get this:

Error: Wrong automake version (Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^      =:+{}]+)}/ at /opt/automake/1.11.1/bin/automake line 4113.), we need 1.11.1.
Aborting.

Apparently, it's an issue with a regex in automake that triggers a
warning starting with Perl 5.22.  It has been fixed in automake 1.15.1.
So I think it's a good excuse to bump the versions of autoconf and
automake used in the gnulib import.  And to avoid requiring multiple
builds of autoconf/automake, it was suggested that we bump the required
version of those tools for all binutils-gdb.

For autoconf, the 2.69 version is universally available, so it's an easy
choice.  For automake, different distros and distro versions have
different automake versions.  But 1.15.1 seems to be the most readily
available as a package.  In any case, it's easy to build it from source.

I removed the version checks from AUTOMAKE_OPTIONS and AC_PREREQ,
because I don't think they are useful in our case.  They only specify a
lower bound for the acceptable version of automake/autoconf.  That's
useful if you let the user choose the version of the tool they want to
use, but want to set a minimum version (because you use a feature that
was introduced in that version).  In our case, we force people to use a
specific version anyway.  For the autoconf version, we have the check in
config/override.m4 that enforces the version we want.  It will be one
less thing to update next time we change autotools version.

I hit a few categories of problems that required some changes.  They are
described below along with the chosen solutions.

Problem 1:

  configure.ac:17: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
  configure.ac:17: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

Solution 1:

  Adjust the code based on the example at that URL.

Problem 2 (in zlib/):

  Makefile.am: error: required file './INSTALL' not found
  Makefile.am:   'automake --add-missing' can install 'INSTALL'
  Makefile.am: error: required file './NEWS' not found
  Makefile.am: error: required file './AUTHORS' not found
  Makefile.am: error: required file './COPYING' not found
  Makefile.am:   'automake --add-missing' can install 'COPYING'

Solution 2:

  Add the foreign option to AUTOMAKE_OPTIONS.

Problem 3:

  doc/Makefile.am:20: error: support for Cygnus-style trees has been removed

Solution 3:

  Remove the cygnus options.

Problem 4:

  Makefile.am:656: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Solution 4:

  Rename "INCLUDES = " to "AM_CPPFLAGS += " (because AM_CPPFLAGS is
  already defined earlier).

Problem 5:

  doc/Makefile.am:71: warning: suffix '.texinfo' for Texinfo files is discouraged; use '.texi' instead
  doc/Makefile.am: warning: Oops!
  doc/Makefile.am:     It appears this file (or files included by it) are triggering
  doc/Makefile.am:     an undocumented, soon-to-be-removed automake hack.
  doc/Makefile.am:     Future automake versions will no longer place in the builddir
  doc/Makefile.am:     (rather than in the srcdir) the generated '.info' files that
  doc/Makefile.am:     appear to be cleaned, by e.g. being listed in CLEANFILES or
  doc/Makefile.am:     DISTCLEANFILES.
  doc/Makefile.am:     If you want your '.info' files to be placed in the builddir
  doc/Makefile.am:     rather than in the srcdir, you have to use the shiny new
  doc/Makefile.am:     'info-in-builddir' automake option.

Solution 5:

  Rename .texinfo files to .texi.

Problem 6:

  doc/Makefile.am: warning: Oops!
  doc/Makefile.am:     It appears this file (or files included by it) are triggering
  doc/Makefile.am:     an undocumented, soon-to-be-removed automake hack.
  doc/Makefile.am:     Future automake versions will no longer place in the builddir
  doc/Makefile.am:     (rather than in the srcdir) the generated '.info' files that
  doc/Makefile.am:     appear to be cleaned, by e.g. being listed in CLEANFILES or
  doc/Makefile.am:     DISTCLEANFILES.
  doc/Makefile.am:     If you want your '.info' files to be placed in the builddir
  doc/Makefile.am:     rather than in the srcdir, you have to use the shiny new
  doc/Makefile.am:     'info-in-builddir' automake option.

Solution 6:

  Remove the hack at the bottom of doc/Makefile.am and use
  the info-in-builddir automake option.

Problem 7:

  doc/Makefile.am:35: error: required file '../texinfo.tex' not found
  doc/Makefile.am:35:   'automake --add-missing' can install 'texinfo.tex'

Solution 7:

  Use the no-texinfo.tex automake option.  We also have one in
  texinfo/texinfo.tex, not sure if we should point to that, or move it
  (or a newer version of it added with automake --add-missing) to
  top-level.

Problem 8:

  Makefile.am:131: warning: source file 'config/tc-aarch64.c' is in a subdirectory,
  Makefile.am:131: but option 'subdir-objects' is disabled
  automake: warning: possible forward-incompatibility.
  automake: At least a source file is in a subdirectory, but the 'subdir-objects'
  automake: automake option hasn't been enabled.  For now, the corresponding output
  automake: object file(s) will be placed in the top-level directory.  However,
  automake: this behaviour will change in future Automake versions: they will
  automake: unconditionally cause object files to be placed in the same subdirectory
  automake: of the corresponding sources.
  automake: You are advised to start using 'subdir-objects' option throughout your
  automake: project, to avoid future incompatibilities.

Solution 8:

  Use subdir-objects, that means adjusting references to some .o that will now
  be in config/.

Problem 9:

  configure.ac:375: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
  ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
  ../../lib/autoconf/general.m4:2601: _AC_COMPILE_IFELSE is expanded from...
  ../../lib/autoconf/general.m4:2617: AC_COMPILE_IFELSE is expanded from...
  ../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
  ../../lib/autoconf/general.m4:2042: AC_CACHE_VAL is expanded from...
  ../../lib/autoconf/general.m4:2063: AC_CACHE_CHECK is expanded from...
  configure.ac:375: the top level

Solution 9:

  Use AC_LANG_SOURCE, or use proper quoting.

Problem 10 (in intl/):

  configure.ac:7: warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
  /usr/share/aclocal/threadlib.m4:36: gl_THREADLIB_EARLY_BODY is expanded from...
  /usr/share/aclocal/threadlib.m4:29: gl_THREADLIB_EARLY is expanded from...
  /usr/share/aclocal/threadlib.m4:318: gl_THREADLIB is expanded from...
  /usr/share/aclocal/lock.m4:9: gl_LOCK is expanded from...
  /usr/share/aclocal/intl.m4:211: gt_INTL_SUBDIR_CORE is expanded from...
  /usr/share/aclocal/intl.m4:25: AM_INTL_SUBDIR is expanded from...
  /usr/share/aclocal/gettext.m4:57: AM_GNU_GETTEXT is expanded from...
  configure.ac:7: the top level

Solution 10:

  Add AC_USE_SYSTEM_EXTENSIONS in configure.ac.

ChangeLog:

	* libtool.m4: Use AC_LANG_SOURCE.
	* configure.ac: Remove AC_PREREQ, use AC_LANG_SOURCE.
	* README-maintainer-mode: Update version requirements.
	* ar-lib: New file.
	* test-driver: New file.
	* configure: Re-generate.

bfd/ChangeLog:

	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
	(INCLUDES): Rename to ...
	(AM_CPPFLAGS): ... this.
	* configure.ac: Remove AC_PREREQ.
	* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove 1.9, cygnus, add
	info-in-builddir no-texinfo.tex.
	(info_TEXINFOS): Rename bfd.texinfo to bfd.texi.
	* doc/bfd.texinfo: Rename to ...
	* doc/bfd.texi: ... this.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* config.in: Re-generate.
	* configure: Re-generate.
	* doc/Makefile.in: Re-generate.

binutils/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* doc/Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus, add
	info-in-builddir no-texinfo.tex.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* config.in: Re-generate.
	* configure: Re-generate.
	* doc/Makefile.in: Re-generate.

config/ChangeLog:

	* override.m4 (_GCC_AUTOCONF_VERSION): Bump from 2.64 to 2.69.

etc/ChangeLog:

	* configure.in: Remove AC_PREREQ.
	* configure: Re-generate.

gas/ChangeLog:

	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11, add subdir-objects.
	(TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O): Add config/ prefix.
	* configure.ac (TARG_CPU_O, OBJ_FORMAT_O, ATOF_TARG_O, emfiles,
	extra_objects): Add config/ prefix.
	* doc/as.texinfo: Rename to...
	* doc/as.texi: ... this.
	* doc/Makefile.am: Rename as.texinfo to as.texi throughout.
	Remove DISTCLEANFILES hack.
	(AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add no-texinfo.tex and
	info-in-builddir.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* config.in: Re-generate.
	* configure: Re-generate.
	* doc/Makefile.in: Re-generate.

gdb/ChangeLog:

	* common/common-defs.h (PACKAGE_NAME, PACKAGE_VERSION,
	PACKAGE_STRING, PACKAGE_TARNAME): Undefine.
	* configure.ac: Remove AC_PREREQ, add missing quoting.
	* gnulib/configure.ac: Modernize usage of
	AC_INIT/AM_INIT_AUTOMAKE.  Remove AC_PREREQ.
	* gnulib/update-gnulib.sh (AUTOCONF_VERSION): Bump to 2.69.
	(AUTOMAKE_VERSION): Bump to 1.15.1.
	* configure: Re-generate.
	* config.in: Re-generate.
	* aclocal.m4: Re-generate.
	* gnulib/aclocal.m4: Re-generate.
	* gnulib/config.in: Re-generate.
	* gnulib/configure: Re-generate.
	* gnulib/import/Makefile.in: Re-generate.

gdb/gdbserver/ChangeLog:

	* configure.ac: Remove AC_PREREQ, add missing quoting.
	* configure: Re-generate.
	* config.in: Re-generate.
	* aclocal.m4: Re-generate.

gdb/testsuite/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.

gold/ChangeLog:

	* configure.ac: Remove AC_PREREQ, add missing quoting and usage
	of AC_LANG_SOURCE.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.
	* testsuite/Makefile.in: Re-generate.

gprof/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* Makefile.am: Remove DISTCLEANFILES hack.
	(AUTOMAKE_OPTIONS): Remove 1.11, add info-in-builddir.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.
	* gconfig.in: Re-generate.

intl/ChangeLog:

	* configure.ac: Add AC_USE_SYSTEM_EXTENSIONS, remove AC_PREREQ.
	* configure: Re-generate.
	* config.h.in: Re-generate.
	* aclocal.m4: Re-generate.

ld/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* Makefile.am: Remove DISTCLEANFILES hack, rename ld.texinfo to
	ld.texi, ldint.texinfo to ldint.texi throughout.
	(AUTOMAKE_OPTIONS): Add info-in-builddir.
	* README: Rename ld.texinfo to ld.texi, ldint.texinfo to
	ldint.texi throughout.
	* gen-doc.texi: Likewise.
	* h8-doc.texi: Likewise.
	* ld.texinfo: Rename to ...
	* ld.texi: ... this.
	* ldint.texinfo: Rename to ...
	* ldint.texi: ... this.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* config.in: Re-generate.
	* configure: Re-generate.

libdecnumber/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* aclocal.m4.

libiberty/ChangeLog:

	* configure.ac: Remove AC_PREREQ.
	* configure: Re-generate.
	* config.in: Re-generate.

opcodes/ChangeLog:

	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.11.
	* configure.ac: Remove AC_PREREQ.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.

readline/ChangeLog.gdb:

	* configure: Re-generate.
	* examples/rlfe/configure: Re-generate.

sim/ChangeLog:

	* All configure.ac: Remove AC_PREREQ.
	* All configure: Re-generate.

zlib/ChangeLog.bin-gdb:

	* configure.ac: Modernize AC_INIT call, remove AC_PREREQ.
	* Makefile.am (AUTOMAKE_OPTIONS): Remove 1.8, cygnus, add
	foreign.
	* Makefile.in: Re-generate.
	* aclocal.m4: Re-generate.
	* configure: Re-generate.
2018-06-19 16:55:06 -04:00
Alan Modra 77236b8349 Build ifunc tests when non-native
Plus a number of fixes to the pr23169 tests.

	* testsuite/lib/ld-lib.exp (check_ifunc_available): Pass without
	running executable when non-native.
	(check_ifunc_attribute_available): Likewise.
	* testsuite/ld-ifunc/pr23169a.rd: Remove extraneous lines.  Match
	st_other strings.  Pass when func is an ifunc.
	* testsuite/ld-ifunc/pr23169b.rd: Remove extraneous lines.  Correct
	reloc regexp.  Correct match-anything line.
	* testsuite/ld-ifunc/pr23169c.rd: Remove extraneous lines.  Match
	st_other strings.
2018-06-18 22:00:32 +09:30
Alan Modra 7f923b7fd2 ELF dynsyms
Many ELF targets arrange to emit a number of section symbols in
.dynsym for use by dynamic relocations.  This happens before the
dynamic relocations are output, and the need for those symbols
determined.  In most cases they are not needed.  A proper analysis of
the need for dynamic section symbols is target specific and tedious,
so this patch just excludes them in the obvious case when no
dynamic relocations are present.

The patch also runs the new pr23161 and pr23162 tests on more targets.

bfd/
	* elf-bfd.h (struct elf_link_hash_table): Add "dynamic_relocs".
	* elflink.c (_bfd_elf_init_2_index_sections): Comment fix.
	(_bfd_elf_add_dynamic_entry): Set "dynamic_relocs".
	(_bfd_elf_link_renumber_dynsyms): Exclude all section symbols when
	"dynamic_relocs" is not set.
	* elfxx-mips.c (count_section_dynsyms): Likewise.
ld/
	* testsuite/ld-elf/readelf.exp: Delete DUMP and selection of
	variant ver_def.vd.
	* testsuite/ld-elf/ver_def-tic6x.vd: Delete.
	* testsuite/ld-elf/shared.exp: Run most pr23161 and pr23162 tests for
	linux, nacl and gnu targets.
	* testsuite/ld-mips-elf/mips-elf.exp: Set base_syms to 1.
	* testsuite/ld-elf/pr23161a.rd: Don't check reloc type.  Allow any
	order of __bss_start, _edata and _end.
	* testsuite/ld-elf/pr23161b.rd: Don't check plt and dyn relocs.
	Allow and order of __bss_start, _edata and _end.
	* testsuite/ld-elf/pr23162.rd: Fail if __bss_start, _edata or _end
	relocs are present rather than testing for no relocations.
	* testsuite/ld-aarch64/gc-plt-relocs.d,
	* testsuite/ld-aarch64/ifunc-1-local.d,
	* testsuite/ld-aarch64/ifunc-1.d,
	* testsuite/ld-aarch64/ifunc-2-local.d,
	* testsuite/ld-aarch64/ifunc-2.d,
	* testsuite/ld-aarch64/ifunc-21.d,
	* testsuite/ld-aarch64/ifunc-3a.d,
	* testsuite/ld-arm/farcall-mixed-lib-v4t.d,
	* testsuite/ld-arm/farcall-mixed-lib.d,
	* testsuite/ld-arm/gc-hidden-1.d,
	* testsuite/ld-arm/tls-gdesc-got.d,
	* testsuite/ld-arm/tls-lib-loc.d,
	* testsuite/ld-arm/tls-longplt-lib.d,
	* testsuite/ld-arm/tls-thumb1.d,
	* testsuite/ld-cris/libdso-10.d,
	* testsuite/ld-cris/libdso-11.d,
	* testsuite/ld-cris/libdso-13b.d,
	* testsuite/ld-cris/libdso-14.d,
	* testsuite/ld-cris/libdso-15.d,
	* testsuite/ld-cris/pic-gc-72.d,
	* testsuite/ld-cris/pic-gc-73.d,
	* testsuite/ld-cris/tls-gc-71.d,
	* testsuite/ld-mips-elf/mips16-pic-4a.nd,
	* testsuite/ld-mips-elf/pic-and-nonpic-3a.dd,
	* testsuite/ld-mips-elf/pie-n32.d,
	* testsuite/ld-mips-elf/pie-n64.d,
	* testsuite/ld-mips-elf/pie-o32.d: Update for removed dynamic
	section symbols.
2018-06-14 11:32:01 +09:30
Hans-Peter Nilsson 1d3bf4a0a0 testsuite/ld-cris/libdso-1.d: Correct recent address pattern update. 2018-06-12 18:37:19 +02:00
Nick Clifton 212b9bc7b4 Fix the PR22983 test so that it will work regardless of the order of the symbols in the dynamic symbol table.
See email thread starting here for more details:
  https://sourceware.org/ml/binutils/2018-06/msg00036.html

	PR 22983
	* testsuite/ld-plugin/lto.exp: Use individual tests to check for
	the presence of each expected symbol.
	* testsuite/ld-plugin/pr22983.1.d: New file.
	* testsuite/ld-plugin/pr22983.2.d: New file.
	* testsuite/ld-plugin/pr22983.3.d: New file.
	* testsuite/ld-plugin/pr22983.4.d: New file.
2018-06-12 13:22:24 +01:00
Nick Clifton d89c18895b Fix syntax error in AArch64 default linker scripts when invoked with -shared.
* emulparams/aarch64elf.sh (OTHER_BSS_END_SYMBOLS): Make the
	definition of the __bss_end__ symbol conditional upon CREATE_SHLIB.
2018-06-12 12:45:49 +01:00
Nick Clifton 5a485b3899 Updated Spanish translations for the binutils/ and ld/ subdirectories.
* po/es.po: Updated Spanish translation.
2018-06-11 10:51:16 +01:00
Maciej W. Rozycki d68033ea86 MIPS/LD/testsuite: Add microMIPS lazy binding stub tests
Adapt the existing regular MIPS lazy binding stub tests for microMIPS
code verification.  Check both regular and `--insn32' variants.

Correct indentation issues in the conditional updated.

	ld/
	* testsuite/ld-mips-elf/stub-dynsym-micromips-1-7fff.d: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-1-8000.d: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-1-fff0.d: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-1-10000.d: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-1-2fe80.d: New
	test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-7fff.d:
	New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-8000.d:
	New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-fff0.d:
	New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-10000.d:
	New test.
	* testsuite/ld-mips-elf/stub-dynsym-micromips-insn32-1-2fe80.d:
	New test.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.  Fix
	indentation.
2018-06-09 01:09:23 +01:00
Maciej W. Rozycki 653e0a1e04 MIPS/LD/testsuite: Fix lazy binding stub test symbol count comment
Update the symbol count in the comment associated with lazy binding stub
tests to match `base_syms', complementing commit 889acb80ac
("MIPS/Linux/LD/testsuite: Linker script _gp scope updates"),
<https://sourceware.org/ml/binutils/2012-08/msg00066.html>, and commit
2f9efdfcdb ("mips/bfd/ld: Fix --as-needed on mips and update related
ld tests"), <https://sourceware.org/ml/binutils/2013-09/msg00131.html>.

	ld/
	* testsuite/ld-mips-elf/mips-elf.exp: Update symbol count in the
	comment associated with lazy binding stub tests.
2018-06-09 01:09:23 +01:00
Maciej W. Rozycki 2f8b83ee96 MIPS/LD: Add missing `mips-*-windiss' target emulation dependency
As from commit 2ebd05b80b ("MIPS/LD: Correct `mips-*-windiss' target
emulation configuration") we have:

EXTRA_EM_FILE=mipself

in `emulparams/elf32mipswindiss.sh', however no corresponding Makefile
`mipself.em' dependency for `eelf32mipswindiss.c'.  Add it.

	ld/
	* Makefile.am (eelf32mipswindiss.c): Add `mipself.em' dependency.
	* Makefile.in: Regenerate.
2018-06-09 01:09:22 +01:00
H.J. Lu ecf99cc092 ld/x86: Remove hidden _edata, __bss_start, and _end
There is no need to put hidden _edata, __bss_start, and _end in dynamic
symbol table in shared libraries.

bfd/

	PR ld/23161
	* elfxx-x86.c (elf_x86_hide_linker_defined): New function.
	(_bfd_x86_elf_link_check_relocs): Use it to hide hidden
	__bss_start, _end and _edata in shared libraries.

ld/

	PR ld/23161
	* testsuite/ld-elf/pr23161d.rd: Remove local _edata, __bss_start,
	and _end from dynamic symbol table.
2018-06-08 12:41:54 -07:00
Alan Modra fd161d860f Define various symbols conditionally in shared libraries
The values of symbols in shared libraries like _end, _edata, and
__bss_start are generally not that useful outside of the shared
library.  This patch defines them conditionally with PROVIDE, since a
shared library might need the local value.  An example is glibc ld.so
local access to "_begin", "_etext" and "_end".  (ld.so gains access to
the local values by making the references using hidden visibility.
That makes the definitions hidden too.)

We can't use PROVIDE_HIDDEN in the linker scripts because the shared
library might need the value of the symbol in the executable.  An
example is freebsd libc dynamic access to "_end".

	PR ld/23161
	* emulparams/aarch64cloudabi.sh: PROVIDE __bss_start__, _bss_end__,
	and __end__ in shared libraries.
	* emulparams/aarch64fbsd.sh: Likewise.
	* emulparams/aarch64linux.sh: Likewise.
	* emulparams/aarch64linux32.sh: Likewise.
	* emulparams/armelf_fuchsia.sh: Likewise.
	* emulparams/armelf_linux.sh: Likewise.
	* emulparams/armelf_phoenix.sh: Likewise.
	* emulparams/aarch64elf.sh: Likewise, and __data_start
	* emulparams/aarch64elf32.sh: Likewise.
	* emulparams/armelf.sh: Likewise.
	* emulparams/armnto.sh: Likewise.
	* emulparams/elf32bmip.sh: Remove duplicate ". = ." from
	OTHER_GOT_SYMBOLS.  PROVIDE _ftext, _fdata, and _fbss in shared libs.
	* emulparams/elf32bmipn32-defs.sh: Likewise.
	* emulparams/elf32frv.sh: PROVIDE __end and __data_start in shared libs.
	* emulparams/elf32lriscv-defs.sh: Tidy.
	* emulparams/elf32mcore.sh: PROVIDE __bss_start and _bss_end in
	shared libs
	* emulparams/elf32ppccommon.sh: PROVIDE __end in shared libs.
	* emulparams/elf32rl78.sh: Tidy.
	* emulparams/i386nto.sh: PROVIDE _btext in shared libs.
	* emulparams/shelf_nto.sh: Likewise.
	* emulparams/shlelf_nto.sh: Likewise.
	* emulparams/score3_elf.sh: PROVIDE _gp, _bss_start__, _bss_end__,
	__bss_end__, __end__, _fdata, _sdata_begin, and _bss_start in
	shared libs.
	* scripttempl/elf.sc: Don't use EXECUTABLE_SYMBOLS for shared
	libraries.  PROVIDE _edata, edata, __bss_start, and _end in shared
	libraries.
	* testsuite/ld-elf/pr23161.map,
	* testsuite/ld-elf/pr23161a.c,
	* testsuite/ld-elf/pr23161b.c,
	* testsuite/ld-elf/pr23161c.c,
	* testsuite/ld-elf/pr23161a.rd,
	* testsuite/ld-elf/pr23161b.rd,
	* testsuite/ld-elf/pr23161c.rd,
	* testsuite/ld-elf/pr23161d.rd: New tests.
	* testsuite/ld-elf/shared.exp: Run ld/23161 tests.
	* testsuite/ld-elf/pr23162.rd,
	* testsuite/ld-aarch64/ifunc-1-local.d,
	* testsuite/ld-aarch64/ifunc-1.d,
	* testsuite/ld-aarch64/ifunc-2-local.d,
	* testsuite/ld-aarch64/ifunc-2.d,
	* testsuite/ld-aarch64/ifunc-21.d,
	* testsuite/ld-aarch64/ifunc-3a.d,
	* testsuite/ld-alpha/tlsbin.rd,
	* testsuite/ld-alpha/tlsbin.sd,
	* testsuite/ld-alpha/tlsbinr.rd,
	* testsuite/ld-alpha/tlspic.rd,
	* testsuite/ld-alpha/tlspic.sd,
	* testsuite/ld-cris/dso-pltdis1.d,
	* testsuite/ld-cris/dso-pltdis2.d,
	* testsuite/ld-cris/dso12-pltdis.d,
	* testsuite/ld-cris/gotplt1.d,
	* testsuite/ld-cris/gotplt2.d,
	* testsuite/ld-cris/gotplt3.d,
	* testsuite/ld-cris/hiddef1.d,
	* testsuite/ld-cris/libdso-1.d,
	* testsuite/ld-cris/libdso-10.d,
	* testsuite/ld-cris/libdso-11.d,
	* testsuite/ld-cris/libdso-12.d,
	* testsuite/ld-cris/libdso-12b.d,
	* testsuite/ld-cris/libdso-12c.d,
	* testsuite/ld-cris/libdso-13.d,
	* testsuite/ld-cris/libdso-13b.d,
	* testsuite/ld-cris/libdso-14.d,
	* testsuite/ld-cris/libdso-15.d,
	* testsuite/ld-cris/libdso-15b.d,
	* testsuite/ld-cris/libdso-1c.d,
	* testsuite/ld-cris/libdso-1d.d,
	* testsuite/ld-cris/libdso-2.d,
	* testsuite/ld-cris/pic-gc-72.d,
	* testsuite/ld-cris/pic-gc-73.d,
	* testsuite/ld-cris/pr16044.d,
	* testsuite/ld-cris/pv32-1.d,
	* testsuite/ld-cris/tls-dso-dtpoffd2.d,
	* testsuite/ld-cris/tls-dso-dtpoffd4.d,
	* testsuite/ld-cris/tls-dso-tpoffgotcomm1.d,
	* testsuite/ld-cris/tls-gc-71.d,
	* testsuite/ld-cris/tls-gd-1.d,
	* testsuite/ld-cris/tls-gd-1h.d,
	* testsuite/ld-cris/tls-gd-2.d,
	* testsuite/ld-cris/tls-gd-2h.d,
	* testsuite/ld-cris/tls-ie-10.d,
	* testsuite/ld-cris/tls-ie-11.d,
	* testsuite/ld-cris/tls-ie-78.d,
	* testsuite/ld-cris/tls-ie-8.d,
	* testsuite/ld-cris/tls-ie-9.d,
	* testsuite/ld-cris/tls-js1.d,
	* testsuite/ld-cris/tls-ld-4.d,
	* testsuite/ld-cris/tls-ld-5.d,
	* testsuite/ld-cris/tls-ld-6.d,
	* testsuite/ld-cris/tls-ld-7.d,
	* testsuite/ld-cris/tls-ldgd-14.d,
	* testsuite/ld-cris/tls-ldgd-15.d,
	* testsuite/ld-cris/tls-ldgdex-14.d,
	* testsuite/ld-cris/tls-ldgdex-15.d,
	* testsuite/ld-cris/tls-ldgdx-14.d,
	* testsuite/ld-cris/tls-ldgdx-15.d,
	* testsuite/ld-cris/tls-legdx-16.d,
	* testsuite/ld-cris/tls-legdx-17.d,
	* testsuite/ld-cris/tls-local-54.d,
	* testsuite/ld-cris/tls-local-60.d,
	* testsuite/ld-cris/tls-local-61.d,
	* testsuite/ld-cris/tls-local-63.d,
	* testsuite/ld-cris/tls-local-64.d,
	* testsuite/ld-cris/tls-ok-30.d,
	* testsuite/ld-cris/tls-ok-32.d,
	* testsuite/ld-cris/tls-ok-34.d,
	* testsuite/ld-cris/tls-und-38.d,
	* testsuite/ld-cris/tls-und-42.d,
	* testsuite/ld-cris/tls-und-46.d,
	* testsuite/ld-cris/tls-und-50.d,
	* testsuite/ld-cris/weakhiddso.d,
	* testsuite/ld-cris/weakref2.d,
	* testsuite/ld-frv/fdpic-shared-1.d,
	* testsuite/ld-frv/fdpic-shared-2.d,
	* testsuite/ld-frv/fdpic-shared-3.d,
	* testsuite/ld-frv/fdpic-shared-4.d,
	* testsuite/ld-frv/fdpic-shared-5.d,
	* testsuite/ld-frv/fdpic-shared-7.d,
	* testsuite/ld-frv/fdpic-shared-8.d,
	* testsuite/ld-frv/tls-dynamic-2.d,
	* testsuite/ld-i386/ibt-plt-1.d,
	* testsuite/ld-i386/ibt-plt-2a.d,
	* testsuite/ld-i386/ibt-plt-2b.d,
	* testsuite/ld-i386/ibt-plt-2c.d,
	* testsuite/ld-i386/ibt-plt-2d.d,
	* testsuite/ld-i386/ibt-plt-3a.d,
	* testsuite/ld-i386/ibt-plt-3b.d,
	* testsuite/ld-i386/ibt-plt-3c.d,
	* testsuite/ld-i386/ibt-plt-3d.d,
	* testsuite/ld-i386/plt2.dd,
	* testsuite/ld-i386/pr20830.d,
	* testsuite/ld-i386/tlsbin-nacl.rd,
	* testsuite/ld-i386/tlsbin.rd,
	* testsuite/ld-i386/tlsbin2-nacl.rd,
	* testsuite/ld-i386/tlsbin2.rd,
	* testsuite/ld-i386/tlsbindesc-nacl.rd,
	* testsuite/ld-i386/tlsbindesc.rd,
	* testsuite/ld-i386/tlsdesc-nacl.rd,
	* testsuite/ld-i386/tlsdesc.rd,
	* testsuite/ld-i386/tlsgdesc-nacl.rd,
	* testsuite/ld-i386/tlsgdesc.rd,
	* testsuite/ld-i386/tlsnopic-nacl.rd,
	* testsuite/ld-i386/tlsnopic.dd,
	* testsuite/ld-i386/tlsnopic.rd,
	* testsuite/ld-i386/tlsnopic.sd,
	* testsuite/ld-i386/tlspic-nacl.rd,
	* testsuite/ld-i386/tlspic.rd,
	* testsuite/ld-i386/tlspic2-nacl.rd,
	* testsuite/ld-i386/tlspic2.rd,
	* testsuite/ld-ia64/merge1.d,
	* testsuite/ld-ia64/merge2.d,
	* testsuite/ld-ia64/merge3.d,
	* testsuite/ld-ia64/merge4.d,
	* testsuite/ld-ia64/merge5.d,
	* testsuite/ld-ia64/tlsbin.rd,
	* testsuite/ld-ia64/tlspic.rd,
	* testsuite/ld-ifunc/ifunc-2-i386-now.d,
	* testsuite/ld-ifunc/ifunc-2-local-i386-now.d,
	* testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d,
	* testsuite/ld-ifunc/ifunc-2-local-x86-64.d,
	* testsuite/ld-ifunc/ifunc-2-x86-64-now.d,
	* testsuite/ld-ifunc/ifunc-2-x86-64.d,
	* testsuite/ld-ifunc/pr17154-i386-now.d,
	* testsuite/ld-ifunc/pr17154-i386.d,
	* testsuite/ld-ifunc/pr17154-x86-64-now.d,
	* testsuite/ld-ifunc/pr17154-x86-64.d,
	* testsuite/ld-m68k/tls-def-1.d,
	* testsuite/ld-m68k/tls-gd-1.d2,
	* testsuite/ld-metag/shared.d,
	* testsuite/ld-metag/stub_pic_app.d,
	* testsuite/ld-mips-elf/rel32-n32.d,
	* testsuite/ld-mips-elf/rel32-o32.d,
	* testsuite/ld-mips-elf/rel64.d,
	* testsuite/ld-powerpc/ambiguousv1.d,
	* testsuite/ld-powerpc/ambiguousv1b.d,
	* testsuite/ld-powerpc/ambiguousv2.d,
	* testsuite/ld-powerpc/ambiguousv2b.d,
	* testsuite/ld-powerpc/tlsexe.d,
	* testsuite/ld-powerpc/tlsexe.r,
	* testsuite/ld-powerpc/tlsexe32.d,
	* testsuite/ld-powerpc/tlsexe32.g,
	* testsuite/ld-powerpc/tlsexe32.r,
	* testsuite/ld-powerpc/tlsexetoc.d,
	* testsuite/ld-powerpc/tlsexetoc.r,
	* testsuite/ld-powerpc/tlsso.d,
	* testsuite/ld-powerpc/tlsso.r,
	* testsuite/ld-powerpc/tlsso32.g,
	* testsuite/ld-powerpc/tlsso32.r,
	* testsuite/ld-powerpc/tlstocso.d,
	* testsuite/ld-powerpc/tlstocso.g,
	* testsuite/ld-powerpc/tlstocso.r,
	* testsuite/ld-s390/gotreloc_31-1.dd,
	* testsuite/ld-s390/tlsbin.dd,
	* testsuite/ld-s390/tlsbin.rd,
	* testsuite/ld-s390/tlsbin_64.dd,
	* testsuite/ld-s390/tlsbin_64.rd,
	* testsuite/ld-s390/tlspic.rd,
	* testsuite/ld-s390/tlspic_64.rd,
	* testsuite/ld-sh/tlsbin-2.d,
	* testsuite/ld-sh/tlspic-2.d,
	* testsuite/ld-sparc/gotop32.rd,
	* testsuite/ld-sparc/gotop64.rd,
	* testsuite/ld-sparc/tlssunbin32.rd,
	* testsuite/ld-sparc/tlssunbin64.rd,
	* testsuite/ld-sparc/tlssunnopic32.rd,
	* testsuite/ld-sparc/tlssunnopic64.rd,
	* testsuite/ld-sparc/tlssunpic32.rd,
	* testsuite/ld-sparc/tlssunpic64.rd,
	* testsuite/ld-x86-64/bnd-branch-1-now.d,
	* testsuite/ld-x86-64/bnd-ifunc-1-now.d,
	* testsuite/ld-x86-64/bnd-ifunc-2-now.d,
	* testsuite/ld-x86-64/bnd-ifunc-2.d,
	* testsuite/ld-x86-64/bnd-plt-1-now.d,
	* testsuite/ld-x86-64/bnd-plt-1.d,
	* testsuite/ld-x86-64/ibt-plt-1-x32.d,
	* testsuite/ld-x86-64/ibt-plt-1.d,
	* testsuite/ld-x86-64/ibt-plt-2a-x32.d,
	* testsuite/ld-x86-64/ibt-plt-2a.d,
	* testsuite/ld-x86-64/ibt-plt-2b-x32.d,
	* testsuite/ld-x86-64/ibt-plt-2b.d,
	* testsuite/ld-x86-64/ibt-plt-2c-x32.d,
	* testsuite/ld-x86-64/ibt-plt-2c.d,
	* testsuite/ld-x86-64/ibt-plt-2d-x32.d,
	* testsuite/ld-x86-64/ibt-plt-2d.d,
	* testsuite/ld-x86-64/ibt-plt-3a-x32.d,
	* testsuite/ld-x86-64/ibt-plt-3a.d,
	* testsuite/ld-x86-64/ibt-plt-3b-x32.d,
	* testsuite/ld-x86-64/ibt-plt-3b.d,
	* testsuite/ld-x86-64/ibt-plt-3c-x32.d,
	* testsuite/ld-x86-64/ibt-plt-3c.d,
	* testsuite/ld-x86-64/ibt-plt-3d-x32.d,
	* testsuite/ld-x86-64/ibt-plt-3d.d,
	* testsuite/ld-x86-64/ilp32-4-nacl.d,
	* testsuite/ld-x86-64/ilp32-4.d,
	* testsuite/ld-x86-64/load1c-nacl.d,
	* testsuite/ld-x86-64/load1c.d,
	* testsuite/ld-x86-64/load1d-nacl.d,
	* testsuite/ld-x86-64/load1d.d,
	* testsuite/ld-x86-64/mpx3n.dd,
	* testsuite/ld-x86-64/mpx4.dd,
	* testsuite/ld-x86-64/mpx4n.dd,
	* testsuite/ld-x86-64/plt2.dd,
	* testsuite/ld-x86-64/pr14207.d,
	* testsuite/ld-x86-64/pr19162.d,
	* testsuite/ld-x86-64/pr20253-1f.d,
	* testsuite/ld-x86-64/pr20253-1l.d,
	* testsuite/ld-x86-64/pr20830a-now.d,
	* testsuite/ld-x86-64/pr20830a.d,
	* testsuite/ld-x86-64/pr20830b-now.d,
	* testsuite/ld-x86-64/pr20830b.d,
	* testsuite/ld-x86-64/pr21038a-now.d,
	* testsuite/ld-x86-64/pr21038a.d,
	* testsuite/ld-x86-64/pr21038b-now.d,
	* testsuite/ld-x86-64/pr21038b.d,
	* testsuite/ld-x86-64/pr21038c-now.d,
	* testsuite/ld-x86-64/pr21038c.d,
	* testsuite/ld-x86-64/tlsbin-nacl.rd,
	* testsuite/ld-x86-64/tlsbin.rd,
	* testsuite/ld-x86-64/tlsbin2-nacl.rd,
	* testsuite/ld-x86-64/tlsbin2.rd,
	* testsuite/ld-x86-64/tlsbindesc-nacl.rd,
	* testsuite/ld-x86-64/tlsbindesc.rd,
	* testsuite/ld-x86-64/tlsdesc-nacl.rd,
	* testsuite/ld-x86-64/tlsdesc.rd,
	* testsuite/ld-x86-64/tlsgdesc-nacl.rd,
	* testsuite/ld-x86-64/tlsgdesc.rd,
	* testsuite/ld-x86-64/tlspic-nacl.rd,
	* testsuite/ld-x86-64/tlspic.rd,
	* testsuite/ld-x86-64/tlspic2-nacl.rd,
	* testsuite/ld-x86-64/tlspic2.rd: Update.
2018-06-08 20:17:34 +09:30
Alan Modra fc6041a776 EXECUTABLE_SYMBOLS -> OTHER_SYMBOLS
EXECUTABLE_SYMBOLS is supposed to be true to its name, only defining
symbols for the executable.

	* emulparams/elf64bmip.sh (EXECUTABLE_SYMBOLS): Don't define.
	(OTHER_SYMBOLS): Define this instead.
	* emulparams/elf32bmipn32.sh (EXECUTABLE_SYMBOLS): Don't define.
	(OTHER_SYMBOLS): Define similarly to elf64bmip.sh.
	* emulparams/elf64hppa.sh (EXECUTABLE_SYMBOLS): Don't define.
	(OTHER_SYMBOLS): Define instead.
2018-06-07 09:10:15 +09:30
Alan Modra 527278f336 TIC6X __c6xabi_DSBT_BASE
Adding an undefined __c6xabi_DSBT_BASE via an EXTERN in the linker
script isn't ideal, as the symbol is not always needed.  This patch
adds the undefined symbol on encountering relocations where it is
implicitly referenced.

bfd/
	* elf32-tic6x.c (elf32_tic6x_check_relocs): Reference
	__c6xabi_DSBT_BASE explicitly for R_C6000_SBR_* relocs.
ld/
	* emulparams/elf32_tic6x_le.sh (EXECUTABLE_SYMBOLS): Don't define.
2018-06-07 09:07:32 +09:30
Alan Modra 08f22593f0 armelf_fbsd and armelf_fuchsia dependencies
* Makefile.am (earmelf_fbsd.c): Correct dependencies.
	(earmelfb_fbsd.c, earmelfb_fuchsia.c): Likewise.
	* Makefile.in: Regenerate.
2018-06-06 21:31:41 +09:30
Alan Modra 27b0767593 PR23254, ld.bfd mishandles file pointers while scanning archive
Best practice is to not mix lseek/read with fseek/fread on the same
underlying file descriptor, as not all stdio implementations will cope.
Since the plugin uses lseek/read while bfd uses fseek/fread this patch
reopens the file for exclusive use by the plugin rather than trying to
restore the file descriptor.  That allows the plugin to read the file
after plugin_call_claim_file too.

bfd/
	PR 23254
	* plugin.c (bfd_plugin_open_input): Allow for possibility of
	nested archives.  Open file again for plugin.
	(try_claim): Don't save and restore file position.  Close file
	if not claimed.
	* sysdep.h (O_BINARY): Define.
ld/
	PR 23254
	* plugin.c (plugin_call_claim_file): Revert 2016-07-19 patch.
	(plugin_object_p): Don't dup file descriptor.
2018-06-05 22:39:11 +09:30