Commit Graph

555 Commits

Author SHA1 Message Date
Alan Modra
fd67aa1129 Update year range in copyright notice of binutils files
Adds two new external authors to etc/update-copyright.py to cover
bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then
updates copyright messages as follows:

1) Update cgen/utils.scm emitted copyrights.
2) Run "etc/update-copyright.py --this-year" with an extra external
   author I haven't committed, 'Kalray SA.', to cover gas testsuite
   files (which should have their copyright message removed).
3) Build with --enable-maintainer-mode --enable-cgen-maint=yes.
4) Check out */po/*.pot which we don't update frequently.
2024-01-04 22:58:12 +10:30
Georg-Johann Lay
0804d18a02 Support rodata in flash for more AVR devices
PR 31124
  * Makefile.am (ALL_EMULATION_SOURCES): Add eavrxmega2_flmap.c and eavrxmega4_flmap.c.
  * Makefile.in: Regenerate.
  * configure.tgt: Add eavrxmega2_flmap and eavrxmega4_flmap to avr's targ_extra_emuls list.
  * emulparams/avrxmega2.sh (MAYBE_FLMAP): Define.
  * emulparams/avrxmega2_flmap.sh: New file.
  * emulparams/avrxmega4.sh (MAYBE_FLMAP): Define.
  * emulparams/avrxmega4_flmap.sh: New file.
  * scripttempl/avr.sc: Add support for HAVE_FLMAP.
2023-12-12 11:29:16 +00:00
Arsen Arsenovi?
862776f26a Finalized intl-update patches
* intl: Remove directory.  Replaced with out-of-tree GNU gettext.
  * .gitignore: Add '/gettext*'.
  * configure.ac (host_libs): Replace intl with gettext. (hbaseargs, bbaseargs, baseargs): Split baseargs into {h,b}baseargs. (skip_barg): New flag.  Skips appending current flag to bbaseargs. <library exemptions>: Exempt --with-libintl-{type,prefix} from target and build machine argument passing.
  * configure: Regenerate.
  * Makefile.def (host_modules): Replace intl module with gettext module. (configure-ld): Depend on configure-gettext.
  * Makefile.in: Regenerate.
  * src-release.sh: Remove references to the intl/ directory.
2023-11-15 12:53:04 +00:00
Claudiu Zissulescu
7f2b40892a Revert "arc: Add new linker emulation and scripts for ARCv3 ISA."
This reverts commit 4deb1ee57f.
2023-09-25 17:02:55 +03:00
Claudiu Zissulescu
4deb1ee57f arc: Add new linker emulation and scripts for ARCv3 ISA.
Add ARCv3's linker bits. Remove obsolete tests.

ld/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* ld/Makefile.am: Add ARC64 targets.
	* ld/configure.tgt: Likewise.
	* ld/Makefile.in: Regenerate.
	* ld/emulparams/arc64elf32.sh: New file.
	* ld/emulparams/arc64elf64.sh: Likewise.
	* ld/emulparams/arc64linux32.sh: Likewise.
	* ld/emulparams/arc64linux64.sh: Likewise.
	* ld/scripttempl/elfarc.sc: Update stack and heap definitions.
	* ld/testsuite/ld-arc/got-weak.d: Deleted file.
	* ld/testsuite/ld-arc/got-weak.s: Likewise.

Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2023-09-25 10:55:51 +03:00
Jerry Zhang Jian
be3bed0696 Fix ld Makefile variable naming: ELF_CLFAGS -> ELF_CFLAGS
Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
2023-09-01 17:59:49 +09:30
Alan Modra
b8a0c93058 ld STRINGIFY
Delete support for old compilers that don't support string
concatentation.

	* Makefile.am (stringify.sed): Delete rule.
	(GEN_DEPENDS, DISTCLEANFILES): Adjust.
	* configure.ac (STRINGIFY): Delete.
	* emultempl/beos.em: Use stringify.sed from srcdir.
	* emultempl/elf.em: Likewise.
	* emultempl/generic.em: Likewise.
	* emultempl/msp430.em: Likewise.
	* emultempl/pdp11.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/pep.em: Likewise.
	* emultempl/stringify.sed: Renamed from..
	* emultempl/astring.sed: ..this.
	* emultempl/ostring.sed: Delete.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
2023-08-26 10:57:00 +09:30
Alan Modra
07f9535fd9 ld .deps/*.Pc files
This patch gets rid of the individual rules including the .Pc
dependency files made while generating e*.c files, replacing them with
a fancy GNU make pattern include.  I've also moved creation of
ldscripts to the makefile since it is possible to run more than one
genscripts at once, resulting in "ldscripts: File exists" messages.

	* Makefile.am: Replace individual include of *.Pc dependency
	files with one pattern rule.
	(.Pc): New dummy rule.
	(ldscripts/stamp): New rule.
	(GEN_DEPENDS): Add ldscripts/stamp.
	(install-data-local): Exclude ldscripts/stamp from install.
	* genscripts.sh: Don't make ldscripts dir.
	* Makefile.in: Regenerate.
2023-08-26 09:20:45 +09:30
Alan Modra
7b793987b5 Use GNU make pattern rule in ld Makefile
Use the pattern rule in a comment from commit 77ac17b845.

	* Makefile.am (run-genscripts): Delete.  Use pattern rule
	e%.c instead.
	* Makefile.in: Regenerate.
2023-08-25 18:56:32 +09:30
Paul Iannetta
835f16daa7 kvx: fix 32-bit build
bfd/
	* Makefile.am: Move elf32-kvx.lo from BFD32_BACKENDS to
	BFD64_BACKENDS.  Remove elfxx-kvx.lo from BFD32_BACKENDS.
	Remove elfxx-kvx.c from BFD32_BACKENDS_CFILES.
	* Makefile.in: Regenerate.
	* config.bfd: Adjust targ_defvec and targ_selvecs and gate them
	behind BFD64.
	* configure.ac: Add target_size=64 to kvx_elf64_*vec.
	* configure: Regenerate.
	* elfnn-kvx.c (elfNN_kvx_stub_name): Cast rel->r_addend to
	uint64_t to match format string.
	(elfNN_kvx_relocate_section): Similarly for r_offset, and
	use PRIx64 in format string.
	* targets.c (_bfd_target_vector <kvx_elf32_vec>): Move inside
	#ifdef BFD64.
ld/
	* Makefile.am: Move eelf32kvx.c from ALL_EMULATION_SOURCES to
	ALL_64_EMULATION_SOURCES.
	* Makefile.in: Regenerate.
2023-08-23 12:38:58 +09:30
Alan Modra
05fbbeacaa generated bfd files, and kvx regen
The elf32-kvx.c and elf64-kvx.c rules in the bfd makefile are
different to the other similar generated files, and that reminded me
that we need to have $srcdir in the generated #line reference back to
the source for debugging, but don't want it for comments in bfd.pot
(because then bfd.pot will likely reference Nick's source tree).
This patch fixes that by making all the #line use $srcdir by virtue of
using $<, and edits bfd.pot.

I also uniq list of files to remove duplicated elfxx-x86.c, sort lists
of files and regen with our standard automake/autoconf.

	* configure: Regenerate.
bfd/
	* Makefile.am: Sort various lists of files.  Use $< in #line
	directive of generated C files.
	(po/SRC-POTFILES.in): uniq SRC_POTFILES.
	(po/BLD-POTFILES.in): uniq BFD_POTFILES.
	* Makefile.in: Regenerate.
	* po/Make-in (bfd.pot): Edit out source dir from comments.
	* po/SRC-POTFILES.in: Regenerate.
gas/
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* po/POTFILES.in: Regenerate.
ld/
	* Makefile.am (ALL_64_EMULATION_SOURCES): Sort.
	* Makefile.in: Regenerate.
2023-08-17 21:44:04 +09:30
Paul Iannetta
6e712424f5 kvx: New port. 2023-08-16 14:22:54 +01:00
Alan Modra
feddea4b46 Add ld makefile dependencies
* Makefile.am (EXTRA_ld_new_SOURCES): Add pep-dll-aarch64.c
	and pep-dll-x86_64.c.
	* Makefile.in: Regenerate.
2023-08-09 08:48:09 +09:30
Matthias Klose
fa2b501cdc Ignore --prefix-file-map compiler option whist running testsuite. 2023-06-29 14:44:52 +01:00
Alan Modra
5f38307ad5 regen ld/Makefile.in 2023-05-09 09:38:16 +09:30
Jan Beulich
02d44d7658 bfd+ld: when / whether to generate .c files
Having been irritated by seeing bfd/elf{32,64}-aarch64.c to be re-
generated in x86-only builds, I came across 769a27ade5 ("Re: bfd
BLD-POTFILES.in dependencies"). I think this went slightly too far, as
outside of maintainer mode dependencies will cause the subset of files
to be (re-)generated which are actually needed for the build.
Generating them all is only needed when wanting to update certain files
under bfd/po/, i.e. in maintainer mode.

In the course of looking around in an attempt to try to understand how
things are meant to work, I further noticed that ld has got things
slightly wrong too: BLD-POTFILES.in depending on $(BLD_POTFILES) isn't
quite right (the output doesn't change when any of the enumerated files
changes; it's the mere presence which matters); like in bfd it looks
like we would better extend BUILT_SOURCES accordingly.

Furthermore it became apparent that ld fails to enumerate the .c files
generated from the .l and .y ones. While in their absence it was benign
whether translatable strings in the source files were actually marked as
such, this now becomes relevant. Mark respective strings at the same
time, but skipping ones which look to be of interest for debugging
purposes only (e.g. such used by printf() enclosed in #ifdef TRACE).
2023-04-04 08:50:18 +02:00
Clément Chigot
567e0dfb01 configure: add new target aarch64-*-nto*
This target has its own ld emulation based on aarch64elf.em.
2023-03-16 15:01:05 +01:00
Alan Modra
75bd292bea Revert ld DIGEST support
This is a hopefully temporary reversion of new ld features for
embedded processors by Ulf Samuelsson, plus some followup patches.

Squashed together from the following:

Revert "lddigest 32-bit support and gcc-4 compile errors"
This reverts commit d7ee19be87110a8f5342cec6e323d83d01c641d1.

Revert "ld: Use correct types for crc64 calculations"
This reverts commit 9a534b9f8e.

Revert "Re: DIGEST: testsuite"
This reverts commit c8e85484d8.

Revert "Regen potfiles"
This reverts commit 4d98c966f8.

Revert "DIGEST: Makefile.*"
This reverts commit 78ef6ab03f.

Revert "DIGEST: calculation"
This reverts commit 5243990191.

Revert "DIGEST: ldlang.*: add timestamp"
This reverts commit bd9466d4aa.

Revert "DIGEST: ldmain.c"
This reverts commit c8f8653fa7.

Revert "DIGEST: ldgram.y"
This reverts commit d73c01be26.

Revert "DIGEST: ldlex.l"
This reverts commit 48b5163a9d.

Revert "DIGEST: testsuite"
This reverts commit a4135d1a48.

Revert "DIGEST: Documentation"
This reverts commit 3ec28966c3.

Revert "DIGEST: NEWS"
This reverts commit 099bf2927d.

Revert "DIGEST: LICENSING"
This reverts commit 5c8a0c6654.
2023-03-10 21:22:16 +10:30
Ulf Samuelsson
3a80a48386 Build ldint
Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
2023-03-07 13:53:11 +00:00
Ulf Samuelsson
78ef6ab03f DIGEST: Makefile.*
The Makefile.in was generated using automake
after adding a few files.

When adding the ldreflect.* files, the autotools
versions were wrong.
After upgrading the host OS, autotools were upgraded to 2.71
reinstalling the desired 2.69 still generates a lot of changes.

Makefile.ini has therefore been manually edited.

Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
2023-03-07 13:53:11 +00:00
Romain Geissler
023b960d59 [PR 30082] Pass $JANSSON_LIBS and $ZSTD_LIBS to ld-bootstrap/bootrap.exp 2023-02-06 10:31:26 +10:30
Nick Clifton
beb6b61d1e Add an extra emulation called arm64pe to the aarch64pe emulation. 2023-01-05 11:00:35 +00:00
Alan Modra
d87bef3a7b Update year range in copyright notice of binutils files
The newer update-copyright.py fixes file encoding too, removing cr/lf
on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and
embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
2023-01-01 21:50:11 +10:30
Alan Modra
f27d07a1c2 pdb build fixes
Enable compilation of ld/pdb.c just for x86, as is done for bfd/pdb.c.
This reduces the size of ld and is necessary with the following
patches that call a COFF-only bfd function from ld/pdb.c.  Without it
we'd break every non-COFF target build.
2022-12-23 19:20:31 +10:30
Indu Bhagat
cf0e0a0ba9 bfd: linker: merge .sframe sections
The linker merges all the input .sframe sections.  When merging, the
linker verifies that all the input .sframe sections have the same
abi/arch.

The linker uses libsframe library to perform key actions on the
.sframe sections - decode, read, and create output data.  This
implies buildsystem changes to make and install libsframe before
libbfd.

The linker places the output .sframe section in a new segment of its
own: PT_GNU_SFRAME.  A new segment is not added, however, if the
generated .sframe section is empty.

When a section is discarded from the final link, the corresponding
entries in the .sframe section for those functions are also deleted.

The linker sorts the SFrame FDEs on start address by default and sets
the SFRAME_F_FDE_SORTED flag in the .sframe section.

This patch also adds support for generation of SFrame unwind
information for the .plt* sections on x86_64.  SFrame unwind info is
generated for IBT enabled PLT, lazy/non-lazy PLT.

The existing linker option --no-ld-generated-unwind-info has been
adapted to include the control of whether .sframe unwind information
will be generated for the linker generated sections like PLT.

Changes to the linker script have been made as necessary.

ChangeLog:

	* Makefile.def: Add install dependency on libsframe for libbfd.
	* Makefile.in: Regenerated.
	* bfd/Makefile.am: Add elf-sframe.c
	* bfd/Makefile.in: Regenerated.
	* bfd/bfd-in2.h (SEC_INFO_TYPE_SFRAME): Regenerated.
	* bfd/configure: Regenerate.
	* bfd/configure.ac: Add elf-sframe.lo.
	* bfd/elf-bfd.h (struct sframe_func_bfdinfo): New struct.
	(struct sframe_dec_info): Likewise.
	(struct sframe_enc_info): Likewise.
	(struct elf_link_hash_table): New member for encoded .sframe
	object.
	(struct output_elf_obj_tdata): New member.
	(elf_sframe): New access macro.
	(_bfd_elf_set_section_sframe): New declaration.
	* bfd/elf.c (get_segment_type): Handle new segment
	PT_GNU_SFRAME.
	(bfd_section_from_phdr): Likewise.
	(get_program_header_size): Likewise.
	(_bfd_elf_map_sections_to_segments): Likewise.
	* bfd/elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Add
	contents to the .sframe sections or .plt* entries.
	* bfd/elflink.c (elf_section_ignore_discarded_relocs): Handle
	SEC_INFO_TYPE_SFRAME.
	(_bfd_elf_default_action_discarded): Handle .sframe section.
	(elf_link_input_bfd): Merge .sframe section.
	(bfd_elf_final_link): Write the output .sframe section.
	(bfd_elf_discard_info): Handle discarding .sframe section.
	* bfd/elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Create
	.sframe section for .plt and .plt.sec.
	(_bfd_x86_elf_finish_dynamic_sections): Handle .sframe from
	.plt* sections.
	* bfd/elfxx-x86.h (PLT_SFRAME_FDE_START_OFFSET): New
	definition.
	(SFRAME_PLT0_MAX_NUM_FRES): Likewise.
	(SFRAME_PLTN_MAX_NUM_FRES): Likewise.
	(struct elf_x86_sframe_plt): New structure.
	(struct elf_x86_link_hash_table): New member.
	(struct elf_x86_init_table): New members for .sframe
	creation.
	* bfd/section.c: Add new definition SEC_INFO_TYPE_SFRAME.
	* binutils/readelf.c (get_segment_type): Handle new segment
	PT_GNU_SFRAME.
	* ld/ld.texi: Update documentation for
	--no-ld-generated-unwind-info.
	* ld/scripttempl/elf.sc: Support .sframe sections.
	* ld/Makefile.am (TESTSFRAMELIB): Use it.
	(check-DEJAGNU): Likewise.
	* ld/Makefile.in: Regenerated.
	* ld/configure.ac (TESTSFRAMELIB): Set to the .so or .a like TESTBFDLIB.
	* ld/configure: Regenerated.
	* bfd/elf-sframe.c: New file.

include/ChangeLog:

	* elf/common.h (PT_GNU_SFRAME): New definition.
	* elf/internal.h (struct elf_segment_map): Handle new segment
	type PT_GNU_SFRAME.

ld/testsuite/ChangeLog:

	* ld/testsuite/ld-bootstrap/bootstrap.exp: Add SFRAMELIB.
	* ld/testsuite/ld-aarch64/aarch64-elf.exp: Add new test
	  sframe-simple-1.
	* ld/testsuite/ld-aarch64/sframe-bar.s: New file.
	* ld/testsuite/ld-aarch64/sframe-foo.s: Likewise.
	* ld/testsuite/ld-aarch64/sframe-simple-1.d: Likewise.
	* ld/testsuite/ld-sframe/sframe-empty.d: New test.
	* ld/testsuite/ld-sframe/sframe-empty.s: New file.
	* ld/testsuite/ld-sframe/sframe.exp: New testsuite.
	* ld/testsuite/ld-x86-64/sframe-bar.s: New file.
	* ld/testsuite/ld-x86-64/sframe-foo.s: Likewise.
	* ld/testsuite/ld-x86-64/sframe-simple-1.d: Likewise.
	* ld/testsuite/ld-x86-64/sframe-plt-1.d: Likewise.
	* ld/testsuite/ld-x86-64/sframe-simple-1.d: Likewise.
	* ld/testsuite/ld-x86-64/x86-64.exp: Add new tests -
	  sframe-simple-1, sframe-plt-1.
	* ld/testsuite/lib/ld-lib.exp: Add new proc to check if
	  assembler supports SFrame section.
	* ld/testsuite/ld-sframe/discard.d: New file.
	* ld/testsuite/ld-sframe/discard.ld: Likewise.
	* ld/testsuite/ld-sframe/discard.s: Likewise.
2022-11-15 15:49:47 -08:00
Alan Modra
53707efa1b Re: aarch64-pe support for LD, GAS and BFD
Fix dependencies for eaarch64pe.c.  Generated files aren't handled
fully automatically.
2022-10-20 15:31:59 +10:30
Mark Harmstone
b41a65333f ld: Add minimal pdb generation 2022-10-20 15:22:37 +10:30
Jedidiah Thompson
c60b380679 aarch64-pe support for LD, GAS and BFD
Allows aarch64-pe to be targeted natively, not having to use objcopy to convert it from ELF to PE.
Based on initial work by Jedidiah Thompson

Co-authored-by: Jedidiah Thompson <wej22007@outlook.com>
Co-authored-by: Zac Walker <zac.walker@linaro.org>
2022-10-19 10:57:12 +02:00
Fangrui Song
2cac01e3ff binutils, gdb: support zstd compressed debug sections
PR29397 PR29563: Add new configure option --with-zstd which defaults to
auto.  If pkgconfig/libzstd.pc is found, define HAVE_ZSTD and support
zstd compressed debug sections for most tools.

* bfd: for addr2line, objdump --dwarf, gdb, etc
* gas: support --compress-debug-sections=zstd
* ld: support ELFCOMPRESS_ZSTD input and --compress-debug-sections=zstd
* objcopy: support ELFCOMPRESS_ZSTD input for
  --decompress-debug-sections and --compress-debug-sections=zstd
* gdb: support ELFCOMPRESS_ZSTD input.  The bfd change references zstd
  symbols, so gdb has to link against -lzstd in this patch.

If zstd is not supported, ELFCOMPRESS_ZSTD input triggers an error.  We
can avoid HAVE_ZSTD if binutils-gdb imports zstd/ like zlib/, but this
is too heavyweight, so don't do it for now.

```
% ld/ld-new a.o
ld/ld-new: a.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
...

% ld/ld-new a.o --compress-debug-sections=zstd
ld/ld-new: --compress-debug-sections=zstd: ld is not built with zstd support

% binutils/objcopy --compress-debug-sections=zstd a.o b.o
binutils/objcopy: --compress-debug-sections=zstd: binutils is not built with zstd support

% binutils/objcopy b.o --decompress-debug-sections
binutils/objcopy: zstd.o: section .debug_abbrev is compressed with zstd, but BFD is not built with zstd support
...
```
2022-09-26 19:50:13 -07:00
Nick Clifton
5bbe6ec5b1 Fix regeneration of ld configure and makefiles 2022-07-08 12:41:48 +01:00
Nick Clifton
631ec08cb1 Update version to 2.39.50 and regenerate files 2022-07-08 11:19:44 +01:00
Jan Beulich
ddd7bf3e28 drop XC16x bits
Commit 04f096fb9e ("Move the xc16x target to the obsolete list") moved
the architecture from the "obsolete but still available" to the
"obsolete / support removed" list in config.bfd, making the architecture
impossible to enable (except maybe via "enable everything" options").

Note that I didn't touch */po/*.po{,t} on the assumption that these
would be updated by some (half)automatic means.
2022-06-27 11:11:46 +02:00
Luca Boccassi
9e2bb0cb5e ld: add --package-metadata
Generate a .note.package FDO package metadata ELF note, following
the spec: https://systemd.io/ELF_PACKAGE_METADATA/

If the jansson library is available at build time (and it is explicitly
enabled), link ld to it, and use it to validate that the input is
correct JSON, to avoid writing garbage to the file. The
configure option --enable-jansson has to be used to explicitly enable
it (error out when not found). This allows bootstrappers (or others who
are not interested) to seamlessly skip it without issues.
2022-05-26 12:56:12 +09:30
Jan Beulich
e961c696dc x86: drop L1OM/K1OM support from ld
This was only rudimentary support anyway; none of the sub-architecture
specific insns were ever supported.
2022-03-24 09:38:55 +01:00
H.J. Lu
ad69b6b861 Regenerate Makefile.in files with automake 1.15.1
Regenerate Makefile.in files with the unmodified automake 1.15.1 to
remove

runstatedir = @runstatedir@

bfd/

	* Makefile.in: Regenerate.

binutils/

	* Makefile.in: Regenerate.

gas/

	* Makefile.in: Regenerate.

gold/

	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Likewise.

gprof/

	* Makefile.in: Regenerate.

ld/

	* Makefile.in: Regenerate.

opcodes/

	* Makefile.in: Regenerate.
2022-01-23 06:59:20 -08:00
Nick Clifton
6c037fdbf0 Update the config.guess and config.sub files from the master repository and regenerate files. 2022-01-17 16:21:22 +00:00
Alan Modra
a2c5833233 Update year range in copyright notice of binutils files
The result of running etc/update-copyright.py --this-year, fixing all
the files whose mode is changed by the script, plus a build with
--enable-maintainer-mode --enable-cgen-maint=yes, then checking
out */po/*.pot which we don't update frequently.

The copy of cgen was with commit d1dd5fcc38ead reverted as that commit
breaks building of bfp opcodes files.
2022-01-02 12:04:28 +10:30
Mike Frysinger
1d5269c994 unify 64-bit bfd checks
Move the 64-bit bfd logic out of bfd/configure.ac and into bfd64.m4
under config so it can be shared between all the other subdirs.

This replaces want64 with enable_64_bit_bfd which was already being
declared, but not used directly.
2022-01-01 12:49:07 -05:00
Mike Frysinger
48b5f33ab1 ld: enable silent build rules
Also add $(AM_V_xxx) to various manual rules in here.
2021-11-29 20:28:29 -05:00
Alan Modra
64f5c8167b Regenerate a couple of files
A couple of files changed on my latest --enable-maintainer-mode
build.  ld/Makefile.in had a missing dependency but better sorting of
the loongson entries.

intl/
	* configure: Regenerate.
ld/
	* Makefile.am: Sort loongson entries.
	* Makefile.in: Regenerate.
2021-11-15 12:20:12 +10:30
liuzhensong
560b3fe208 LoongArch ld support
2021-10-22  Chenghua Xu  <xuchenghua@loongson.cn>
	    Zhensong Liu  <liuzhensong@loongson.cn>
	    Weinan Liu  <liuweinan@loongson.cn>
	    Xiaolin Tang  <tangxiaolin@loongson.cn>

ld/
	* Makefile.am: Add LoongArch.
	* NEWS: Mention LoongArch support.
	* configure.tgt: Add LoongArch.
	* emulparams/elf32loongarch-defs.sh: New.
	* emulparams/elf32loongarch.sh: Likewise.
	* emulparams/elf64loongarch-defs.sh: Likewise.
	* emulparams/elf64loongarch.sh: Likewise.
	* emultempl/loongarchelf.em: Likewise.
	* Makefile.in: Regenerate.
	* po/BLD-POTFILES.in: Regenerate.
ld/testsuite/
	* ld-loongarch-elf/disas-jirl.d: New.
	* ld-loongarch-elf/disas-jirl.s: Likewise.
	* ld-loongarch-elf/jmp_op.d: Likewise.
	* ld-loongarch-elf/jmp_op.s: Likewise.
	* ld-loongarch-elf/ld-loongarch-elf.exp: Likewise.
	* ld-loongarch-elf/macro_op.d: Likewise.
	* ld-loongarch-elf/macro_op.s: Likewise.
	* ld-loongarch-elf/syscall-0.s: Likewise.
	* ld-loongarch-elf/syscall-1.s: Likewise.
	* ld-loongarch-elf/syscall.d: Likewise.
	* ld-srec/srec.exp: Add LoongArch.
	* ld-unique/pr21529.d: Likewise.
2021-10-24 21:36:32 +10:30
Alan Modra
8ac439689f Move eelf_mipsel_haiki.c to ALL_64_EMULATION_SOURCES
--enable-targets=all on a 32-bit host results in a link failure with
undefined references due to elfxx-mips.c not being compiled.  This
patch fixes that by putting eelf_mipsel_haiki.c in the correct
EMULATION_SOURCES Makefile variable.  I've also added a bunch of
missing file dependencies and sorted a few things so that it's easier
to verify dependencies are present.

	* Makfile.am: Add missing haiku dependencies, sort.
	(ALL_EMULATION_SOURCES): Sort.  Move eelf_mipsel_haiku.c to..
	(ALL_64_EMULATION_SOURCES): ..here.  Sort.
	* Makfile.in: Regenerate.
2021-09-20 11:38:55 +09:30
Alan Modra
669d511534 ld testsuite tidy
Fixes a few issues:
1) If you use "-fsanitize=address,undefined" in CFLAGS, the Makefile
attempt to trim off -fsanitize options left us with ",undefined".
2) ld_compile adds CFLAGS_FOR_TARGET itself, no need to pass it.
3) CFLAGS might be needed linking bootstrap test.

	* Makefile.am (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Trim off
	all -fsanitize=*.
	* Makefile.in: Regenerate.
	* testsuite/ld-bootstrap/bootstrap.exp: Use CFLAGS when linking.
	* testsuite/ld-cdtest/cdtest.exp: Use CFLAGS_FOR_TARGET when
	linking.
	* testsuite/ld-auto-import/auto-import.exp: Don't pass
	CFLAGS_FOR_TARGET to ld_compile.
	* testsuite/ld-cygwin/exe-export.exp: Likewise.
	* testsuite/ld-elfvers/vers.exp: Likewise.
	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
	* testsuite/ld-elfweak/elfweak.exp: Likewise.
	* testsuite/ld-gc/gc.exp: Likewise.
	* testsuite/ld-pe/pe-compile.exp: Likewise.
	* testsuite/ld-pe/pe-run.exp: Likewise.
	* testsuite/ld-pe/pe-run2.exp: Likewise.
	* testsuite/ld-plugin/plugin.exp: Likewise.
	* testsuite/ld-shared/shared.exp: Likewise.
	* testsuite/ld-elfcomm/elfcomm.exp: Likewise, and don't allow
	nios2 testing to trash CFLAGS_FOR_TARGET.
	* testsuite/ld-scripts/crossref.exp: Don't pass options in
	CC_FOR_TARGET, do so in CFLAGS_FOR_TARGET instead.
	* testsuite/ld-srec/srec.exp: Likewise, and for CXX.
2021-09-03 16:26:21 +09:30
Alan Modra
ad77db1c02 CC_FOR_TARGET et al
The top level Makefile, the ld Makefile and others, define
CC_FOR_TARGET to be a compiler for the binutils target machine.  This
is the compiler that should be used for almost all tests with C
source.  There are _FOR_TARGET versions of CFLAGS, CXX, and CXXFLAGS
too.  This was all supposed to work with the testsuite .exp files
using CC for the target compiler, and CC_FOR_HOST for the host
compiler, with the makefiles passing CC=$CC_FOR_TARGET and
CC_FOR_HOST=$CC to the runtest invocation.

One exception to the rule of using CC_FOR_TARGET is the native-only ld
bootstrap test, which uses the newly built ld to link a copy of
itself.  Since the files being linked were created with the host
compiler, the boostrap test should use CC and CFLAGS, in case some
host compiler option provides needed libraries automatically.
However, bootstrap.exp used CC where it should have used CC_FOR_HOST.
I set about fixing that problem, then decided that playing games in
the makefiles with CC was a bad idea.  Not only is it confusing, but
other dejagnu code knows about CC_FOR_TARGET.  See dejagnu/target.exp.

So this patch gets rid of the makefile variable renaming and changes
all the .exp files to use the correct _FOR_TARGET variables.
CC_FOR_HOST and CFLAGS_FOR_HOST disappear.  A followup patch will
correct bootstrap.exp to use CFLAGS, and a number of other things I
noticed.

binutils/
	* testsuite/lib/binutils-common.exp (run_dump_test): Use
	CC_FOR_TARGET and CFLAGS_FOR_TARGET rather than CC and CFLAGS.
ld/
	* Makefile.am (check-DEJAGNU): Don't set CC to CC_FOR_TARGET
	and similar.  Pass variables with unchanged names.  Don't set
	CC_FOR_HOST or CFLAGS_FOR_HOST.
	* Makefile.in: Regenerate.
	* testsuite/config/default.exp: Update default CC and similar.
	(compiler_supports, plug_opt): Use CC_FOR_TARGET.
	* testsuite/ld-cdtest/cdtest.exp: Replace all uses of CC with
	CC_FOR_TARGET, and similarly for CFLAGS, CXX and CXXFLAGS.
	* testsuite/ld-auto-import/auto-import.exp: Likewise.
	* testsuite/ld-cygwin/exe-export.exp: Likewise.
	* testsuite/ld-elf/dwarf.exp: Likewise.
	* testsuite/ld-elf/indirect.exp: Likewise.
	* testsuite/ld-elf/shared.exp: Likewise.
	* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
	* testsuite/ld-elfvers/vers.exp: Likewise.
	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
	* testsuite/ld-elfweak/elfweak.exp: Likewise.
	* testsuite/ld-gc/gc.exp: Likewise.
	* testsuite/ld-ifunc/ifunc.exp: Likewise.
	* testsuite/ld-mn10300/mn10300.exp: Likewise.
	* testsuite/ld-pe/pe-compile.exp: Likewise.
	* testsuite/ld-pe/pe-run.exp: Likewise.
	* testsuite/ld-pe/pe-run2.exp: Likewise.
	* testsuite/ld-pie/pie.exp: Likewise.
	* testsuite/ld-plugin/lto.exp: Likewise.
	* testsuite/ld-plugin/plugin.exp: Likewise.
	* testsuite/ld-scripts/crossref.exp: Likewise.
	* testsuite/ld-selective/selective.exp: Likewise.
	* testsuite/ld-sh/sh.exp: Likewise.
	* testsuite/ld-shared/shared.exp: Likewise.
	* testsuite/ld-srec/srec.exp: Likewise.
	* testsuite/ld-undefined/undefined.exp: Likewise.
	* testsuite/ld-unique/unique.exp: Likewise.
	* testsuite/ld-x86-64/tls.exp: Likewise.
	* testsuite/lib/ld-lib.exp: Likewise.
libctf/
	* Makefile.am (check-DEJAGNU): Don't set CC to CC_FOR_TARGET.
	Pass CC and CC_FOR_TARGET.  Don't set CC_FOR_HOST.
	* Makefile.in: Regenerate.
	* testsuite/config/default.exp: Update default CC and similar.
	* testsuite/lib/ctf-lib.exp (run_native_host_cmd): Use CC rather
	than CC_FOR_HOST.
	(run_lookup_test): Use CC_FOR_TARGET and CFLAGS_FOR_TARGET.
2021-09-03 16:26:09 +09:30
Alan Modra
06520412a5 haiku tidy
--enable-maintainer-mode showed a number of files needing to be
regenerated, and in the case of ld/Makefile.in that the file was
regenerated by hand.  Nothing to see here really.

ld/
	* Makefile.am (ALL_64_EMULATION_SOURCES): Sort haiku entry.
	* Makefile.in: Regenerate.
	* po/BLD-POTFILES.in: Regenerate.
libctf/
	* configure: Regenerate.
zlib/
	* configure: Regenerate.
2021-09-03 11:45:58 +09:30
Alexander von Gluck IV
d85e70a35b Add support for the haiku operating system. These are the os support patches we have been grooming and maintaining for quite a few years over on git.haiku-os.org. All of these architectures are working and most have been stable for quite some time. 2021-09-02 12:19:14 +01:00
Nick Clifton
22604fe675 Prevent libdel.dll.a from being installed on Windows based systems.
PR 27113
	* Makefile.am (install-data-local): Also delete libdep.dll.a if it
	is present.
	* Makefile.in: Regenerate.
2021-05-11 11:06:53 +01:00
Mike Frysinger
cf758b3960 support generating multi-html pages in parallel
Use the pattern from other projects where we generate the html pages
in a dir named the same as the project.  So now we have:
gas/doc/gas.html - single html page
gas/doc/gas/ - multiple html pages

This works for projects that have a doc/ subdir already, but gprof &
ld require a little tweaking since they generate their docs in their
respective toplevels.
2021-05-08 12:06:07 -04:00
Mike Frysinger
2faf902da5 generate single html manual page by default
This better matches other GNU projects like autoconf/automake where
the html manual is the single page form.  We'll support the multi-page
form in a follow up change.
2021-05-08 11:58:19 -04:00
Alan Modra
203a206d14 riscv --enable-targets=all on 32-bit host
Attempting to build --enable-targets=all on a 32-bit host results in a
number of errors like the following.

eelf32lriscv.o: in function `gldelf32lriscv_after_allocation':
eelf32lriscv.c:98: undefined reference to `bfd_elf32_riscv_restart_relax_sections'

That's due to needing --enable-64-bit-bfd to get the riscv BFD support
built.

	* Makefile.am (ALL_EMULATION_SOURCES): Move riscv files to..
	(ALL_64_EMULATION_SOURCES): ..here.
	* Makefile.in: Regenerate.
2021-03-12 23:01:01 +10:30