Commit Graph

112700 Commits

Author SHA1 Message Date
Nick Clifton
36795a207d Updated translations for the gas and binutils sub-directories 2023-01-16 10:44:44 +00:00
GDB Administrator
fb25c2afe5 Automatic date update in version.in 2023-01-16 00:01:23 +00:00
GDB Administrator
a2b1e3c0d1 Automatic date update in version.in 2023-01-15 00:01:21 +00:00
Nick Clifton
78eca0130f Re-enable development. Update version to 2.40.0 2023-01-14 15:34:17 +00:00
Nick Clifton
32778522c7 Fix snafu in version number. Regenerate files 2023-01-14 13:52:46 +00:00
Nick Clifton
c203a2e3a8 Set development and experimental to false. Update version number to 2.40. Add release markers. Regenerate files 2023-01-14 13:42:32 +00:00
GDB Administrator
44767ca811 Automatic date update in version.in 2023-01-14 00:00:52 +00:00
Nick Clifton
ea766c9dd6 Updated Romainian translation for the bfd sub-directory 2023-01-13 11:43:18 +00:00
GDB Administrator
b90d8cc85a Automatic date update in version.in 2023-01-13 00:01:17 +00:00
Hans-Peter Nilsson
fedaf87c95 ARM: Fix ld bloat introduced between binutils-2.38 and 2.39
Since commit 9833b7757d, "PR28824, relro security issues",
ELF_MAXPAGESIZE matters much more, with regards to layout of
the linked file.  That commit fixed an actual bug, but also
exposes a problem for targets were that value is too high.

For example, for ARM(32, a.k.a. "Aarch32") specifically
bfd_arch_arm, it's set to 64 KiB, making all Linux(/GNU)
targets pay an extra amount of up to 60 KiB of bloat in
DSO:s and executables.  This matters when there are many
such files, and where storage is expensive.

It's *mostly* bloat when using a Linux kernel, as ARM(32) is
a good example of an target where ELF_MAXPAGESIZE is set to
an extreme value for an obscure corner-case.  The ARM
(32-bit) kernel has 4 KiB pages, has had that value forever,
and can't be configured to any other value.  The use-case is
IIUC "Aarch32" emulation on an "Aarch64" (arm64) kernel, but
not just that, but a setup where the Linux page-size is
configured to something other than the *default* 4 KiB.  Not
sure there actually any such systems in use, again with
both Aarch32 compatibility support and a non-4KiB pagesize,
with all the warnings in the kernel config and requiring the
"EXPERT" level set on.

So, let's do like x86-64 in a2267dbfc9 "x86-64: Use only
one default max-page-size" and set ELF_MAXPAGESIZE to 4096.

bfd:
	* elf32-arm.c (ELF_MAXPAGESIZE): Always set to 0x1000.
(cherry picked from commit 1a26a53a0d)
2023-01-12 17:41:45 +01:00
Hans-Peter Nilsson
cd331e1d73 ld/testsuite: Adjust for ELF_MAXPAGESIZE 0x1000
Many tests reflect a setting of ELF_MAXPAGESIZE to 64 KiB.
With ELF_MAXPAGESIZE changed to 4 KiB, layout is sometimes
different and symbols end up in other places.  Avoid churn
and regexpification of old test patterns by passing the
max-page-size setting active at the time.

ld/testsuite:

	* testsuite/ld-arm/arm-elf.exp,
        testsuite/ld-arm/non-contiguous-arm2.d,
        testsuite/ld-arm/non-contiguous-arm3.d,
        testsuite/ld-arm/non-contiguous-arm5.d,
        testsuite/ld-arm/non-contiguous-arm6.d,
        testsuite/ld-arm/thumb-plt-got.d, testsuite/ld-arm/thumb-plt.d:
	Pass -z max-page-size=0x10000 explicitly to test that rely on
	that value in output-matching patterns.
(cherry picked from commit b305015577)
2023-01-12 17:41:08 +01:00
Nick Alcock
999e7ed7a2 libctf: ctf-link outdated input check faulty
This check has a pair of faults which, combined, can lead to memory
corruption.  Firstly, it assumes that the values of the ctf_link_inputs
hash are ctf_dict_t's: they are not, they are ctf_link_input_t's, a much
shorter structure.  So the flags check which is the core of this is
faulty (but happens, by chance, to give the right output on most
architectures, since usually we happen to get a 0 here, so the test that
checks this usually passes).  Worse, the warning that is emitted when
the test fails is added to the wrong dict -- it's added to the input
dict, whose warning list is never consumed, rendering the whole check
useless.  But the dict it adds to is still the wrong type, so we end up
overwriting something deep in memory (or, much more likely,
dereferencing a garbage pointer and crashing).

Fixing both reveals another problem: the link input is an *archive*
consisting of multiple members, so we have to consider whether to check
all of them for the outdated-func-info thing we are checking here.
However, no compiler exists that emits a mixture of members with this
flag on and members with it off, and the linker always reserializes (and
upgrades) such things when it sees them: so all members in a given
archive must have the same value of the flag, so we only need to check
one member per input archive.

libctf/
	PR libctf/29983
	* ctf-link.c (ctf_link_warn_outdated_inputs): Get the types of
        members of ctf_link_inputs right, fixing a possible spurious
        tesst failure / wild pointer deref / overwrite.  Emit the
        warning message into the right dict.
2023-01-12 15:23:51 +00:00
Nick Clifton
7145c3f610 Ensure that libbacktrace/allocfail.sh is not deleted when creating release tarballs.
* Makefile.am (CLEANFILES): Import patch from upstream to prevent
	allocafail.sh from being removed when running 'make clean'.
2023-01-12 13:37:59 +00:00
GDB Administrator
e888df8995 Automatic date update in version.in 2023-01-12 00:02:07 +00:00
Nick Clifton
3e307d538c Fix a potential illegal memory access in the BFD library when parsing a corrupt DWARF file.
PR 29988
	* dwarf2.c (read_indexed_address): Fix check for an out of range
	offset.
2023-01-11 12:13:46 +00:00
Jan Beulich
ad2021a0f7 gas/RISC-V: adjust assembler for opcode table re-ordering
PR gas/29940

With the single-operand JAL entry now sitting ahead of the two-operand
one, the parsing of a two-operand insn would first try to parse an 'a'-
style operand, resulting in the insertion of bogus (and otherwise
unused) undefined symbols in the symbol table, having register names.
Since 'a' is used as 1st operand only with J and JAL, and since JAL is
the only insn _also_ allowing for a register as 1st operand (and then
there being a 2nd one), special case this parsing aspect right there.

Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-01-11 10:35:54 +01:00
GDB Administrator
5cf8624d4d Automatic date update in version.in 2023-01-11 00:01:22 +00:00
Stefan Schulze Frielinghaus
38775ca9a7 IBM zSystems: Fix offset relative to static TLS
For local exec TLS relocations of the form foo@NTPOFF+x the addend was
ignored.

bfd/ChangeLog:

	* elf32-s390.c (elf_s390_relocate_section): Honor addend for
	R_390_TLS_LE32.
	* elf64-s390.c (elf_s390_relocate_section): Honor addend for
	R_390_TLS_LE64.

ld/ChangeLog:

	* testsuite/ld-s390/reloctlsle-1.d: New test.
	* testsuite/ld-s390/reloctlsle-1.s: New test.

(cherry picked from commit aefebe82dc)
2023-01-10 14:51:47 +01:00
GDB Administrator
ddf8d80aef Automatic date update in version.in 2023-01-10 00:01:55 +00:00
Indu Bhagat
b6250e0b72 sframe: fix the defined SFRAME_FRE_TYPE_*_LIMIT constants
An earlier commit 3f107464 defined the SFRAME_FRE_TYPE_*_LIMIT
constants.  These constants are used (by gas and libsframe) to pick an
SFrame FRE type based on the function size.  Those constants, however,
were buggy, causing the generated SFrame sections to be bloated as
SFRAME_FRE_TYPE_ADDR2/SFRAME_FRE_TYPE_ADDR4 got chosen more often than
necessary.

gas/
	* sframe-opt.c (sframe_estimate_size_before_relax): Use
	typecast.
	(sframe_convert_frag): Likewise.

libsframe/
	* sframe.c (sframe_calc_fre_type): Use a more appropriate type
	for argument.  Adjust the check for SFRAME_FRE_TYPE_ADDR4_LIMIT
	to keep it warning-free but meaningful.

include/
	* sframe-api.h (sframe_calc_fre_type): Use a more appropriate
	type for the argument.
	* sframe.h (SFRAME_FRE_TYPE_ADDR1_LIMIT): Correct the constant.
	(SFRAME_FRE_TYPE_ADDR2_LIMIT): Likewise.
	(SFRAME_FRE_TYPE_ADDR4_LIMIT): Likewise.

(cherry picked from commit 725a19bfd1)
2023-01-09 09:47:42 -08:00
Indu Bhagat
2ffa66fc9f libsframe: adjust an incorrect check in flip_sframe
When sframe_encoder_write needs to flip the buffer containing the SFrame
section before writing, it is not necessary that the SFrame FDES are in
the order of their sfde_func_start_fre_off.  On the contrary, SFrame
FDEs will be sorted in the order of their start address.  So, remove
this incorrect assumption which is basically assuming that the last
sfde_func_start_fre_off seen will help determine the end of the flipped
buffer.

The function now keeps track of the bytes_flipped and then compares it with
the expected value.  Also, added two more checks at appropriate places:
 - check that the SFrame FDE read is within bounds
 - check that the SFrame FRE read is within bounds

libsframe/

	* sframe.c (flip_sframe): Adjust an incorrect check.
	Add other checks to ensure reads are within the buffer size.

(cherry picked from commit cd9aea32cf)
2023-01-09 09:47:24 -08:00
Christophe Lyon
dcaa0ed8f6 Skip ld/pr23169 test on arm.
The test is already skipped on several targets (including AArch64)
because it's invalid.

	* testsuite/ld-ifunc/ifunc.exp: Skip pr23169 on arm.
2023-01-09 16:52:42 +01:00
Christophe Lyon
5d546b26ce Fix PR18841 ifunc relocation ordering
In order to get the ifunc relocs properly sorted the correct class
needs to be returned.  The code mimics what has been done for AArch64.

Fixes:
FAIL: Run pr18841 with libpr18841b.so
FAIL: Run pr18841 with libpr18841c.so
FAIL: Run pr18841 with libpr18841bn.so (-z now)
FAIL: Run pr18841 with libpr18841cn.so (-z now)

	bfd/
	PR ld/18841
	* elf32-arm.c (elf32_arm_reloc_type_class): Return
	reloc_class_ifunc for ifunc symbols.

	ld/testsuite/
	* ld-arm/ifunc-12.rd: Update relocations order.
	* ld-arm/ifunc-3.rd: Likewise.
	* ld-arm/ifunc-4.rd: Likewise.
2023-01-09 16:52:40 +01:00
Nick Clifton
417d329214 Updated transaltions for the gprof and binutils sub-directories 2023-01-09 10:23:27 +00:00
GDB Administrator
114a486049 Automatic date update in version.in 2023-01-09 00:02:09 +00:00
Alan Modra
48d455786c PR29972, inconsistent format specification in singular form
PR 29972
	* readelf.c (process_dynamic_section): Correct format string.

(cherry picked from commit 02da71ee20)
2023-01-08 13:12:43 +10:30
GDB Administrator
261a13935c Automatic date update in version.in 2023-01-08 00:01:29 +00:00
GDB Administrator
3772b524b7 Automatic date update in version.in 2023-01-07 00:01:09 +00:00
Jan Beulich
386c173fc2 ld: yet another PDB build fix (or workaround)
Older bash looks to improperly deal with backslashes in here-documents,
leaving them in place on the escaped double quotes inside the parameter
expansion. Convert to a model without using such a construct, by simply
splitting the here-documents into three ones.
2023-01-06 15:23:13 +01:00
Nick Clifton
e1aec9c131 Updated Bulgarian and Russian translations for LD and BFD respectively 2023-01-06 11:01:44 +00:00
GDB Administrator
6d21de753d Automatic date update in version.in 2023-01-06 00:01:51 +00:00
Nick Clifton
c882857796 Avoid unaligned pointer reads in PEP idata section 2023-01-05 11:57:00 +00:00
Nick Clifton
22bab89de8 Updated Bulgarian and Russian translations for the gprof subdirectory 2023-01-05 08:26:39 +00:00
GDB Administrator
0dc5424c29 Automatic date update in version.in 2023-01-05 00:01:26 +00:00
Alan Modra
4a22a3348e Merge config/picflag.m4 from gcc 2023-01-04 22:14:03 +10:30
Alan Modra
1061395368 Update some more copyright year ranges
These files disappear in commit 3002e78a7d but are still on the branch.
2023-01-04 22:14:03 +10:30
Alan Modra
141086413b Update year range in gprofng copyright notices
This adds 'Innovative Computing Labs' as an external author to
update-copyright.py, to cover the copyright notice in
gprofng/common/opteron_pcbe.c, and uses that plus another external
author 'Oracle and' to update gprofng copyright dates.  I'm not going
to commit 'Oracle and' as an accepted author, but that covers the
string "Copyright (c) 2006, 2012, Oracle and/or its affiliates. All
rights reserved." found in gprofng/testsuite/gprofng.display/jsynprog
files.
2023-01-04 22:14:03 +10:30
Alan Modra
6d53c0962c 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-04 22:14:02 +10:30
Alan Modra
26e7db51c2 Update etc/update-copyright.py
This picks up some improvements from gcc/contrib.  exceptions must
derive from BaseException, port to python3, retain original file mode,
fix name of script in examples.

Adds libsframe to list of default dirs.  I would have added gprofng
too but there are some files claiming copyright by authors other than
the Free Software Foundation.
2023-01-04 22:14:02 +10:30
Andreas K. Huettel
f4e184b274 Fix AArch64 linker testsuite failures triggered by differences in build environments.
PR 29843
	* testsuite/ld-aarch64/bti-plt-5.d: Relax regxps slightly to allow
	for differences in build environments.
	* testsuite/ld-aarch64/tls-relax-gdesc-le-now.d: Likewise.
2023-01-04 09:31:12 +00:00
Mark Harmstone
2ebe33ffd1 Avoid unaligned pointer reads in PEP .idata section
This is something I discovered when working on aarch64, though it's
relevant to x86_64 too.

The PE32+ imports are located in the .idata section, which starts off
with a 20-byte structure for each DLL, containing offsets into the rest
of the section. This is the Import Directory Table in
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format, which
is a concatenation of the .idata$2 sections. This is then followed by an
20 zero bytes generated by the linker script, which calls this .idata$3.

After this comes the .idata$4 entries for each function, which the
loader overwrites with the function pointers. Because there's no padding
between .idata$3 and .idata$4, this means that if there's an even number
of DLLs, the function pointers won't be aligned on an 8-byte boundary.

Misaligned reads are slower on x86_64, but this is more important on
aarch64, as the e.g. `ldr x0, [x0, :lo12:__imp__func]` the compiler
might generate requires __imp__func (the .idata$4 entry) to be aligned
to 8 bytes. Without this you get IMAGE_REL_ARM64_PAGEOFFSET_12L overflow
errors.
2023-01-04 03:49:15 +00:00
GDB Administrator
3609dbe28f Automatic date update in version.in 2023-01-04 00:01:13 +00:00
Nick Clifton
447625978d Updated translations for various languages and sub-directories 2023-01-03 11:37:29 +00:00
GDB Administrator
5904c7eaeb Automatic date update in version.in 2023-01-03 00:00:51 +00:00
GDB Administrator
9e3a208078 Automatic date update in version.in 2023-01-02 00:00:49 +00:00
Nick Clifton
a6452fe932 Update version number and regenerate files 2022-12-31 12:25:20 +00:00
Nick Clifton
a72b07181d Add markers for 2.40 branch 2022-12-31 12:05:28 +00:00
Nick Clifton
e3a5d52075 sync libiberty sources with gcc mainline 2022-12-31 12:04:51 +00:00
Tom de Vries
08c59458a1 [gdb/cli] Add maintenance ignore-probes
There's a command "disable probes", but SystemTap probes, for instance
libc:longjmp cannot be disabled:
...
$ gdb -q -batch a.out -ex start -ex "disable probes libc ^longjmp$"
  ...
Probe libc:longjmp cannot be disabled.
Probe libc:longjmp cannot be disabled.
Probe libc:longjmp cannot be disabled.
...

Add a command "maintenance ignore-probes" that ignores probes during
get_probes, such that we can easily pretend to use a libc without the
libc:longjmp probe:
...
(gdb) maint ignore-probes -verbose libc ^longjmp$
ignore-probes filter has been set to:
PROVIDER: 'libc'
PROBE_NAME: '^longjmp$'
OBJNAME: ''
(gdb) start ^M
  ...
Ignoring SystemTap probe libc longjmp in /lib64/libc.so.6.^M
Ignoring SystemTap probe libc longjmp in /lib64/libc.so.6.^M
Ignoring SystemTap probe libc longjmp in /lib64/libc.so.6.^M
...

The "Ignoring ..." messages can be suppressed by not using -verbose.

Note that as with "disable probes", running simply "maint ignore-probes"
ignores all probes.

The ignore-probes filter can be reset by using:
...
(gdb) maint ignore-probes -reset
ignore-probes filter has been reset
...

For now, the command is only supported for SystemTap probes.

PR cli/27159
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27159
2022-12-31 10:23:06 +01:00
Mark Harmstone
a667697f36 ld/testsuite: Don't add index to sizes in pdb.exp 2022-12-31 19:26:23 +10:30