]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
5 weeks agox86: Check MODRM for call and jmp in binutils older than 2.45 binutils-2_38-branch
H.J. Lu [Thu, 22 May 2025 03:29:49 +0000 (11:29 +0800)] 
x86: Check MODRM for call and jmp in binutils older than 2.45

When i386 glibc was assembled with commit:

commit 11c2852449825a5f486f63bc40aabed56b7c04c1 (HEAD)
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Feb 21 10:24:50 2025 +0100

    x86: widen @got{,pcrel} support to PUSH and APX IMUL

    With us doing the transformation to an immediate operand for MOV and
    various ALU insns, there's little reason to then not support the same
    conversion for the other two insns which have respective immediate
    operand forms. Unfortunately for IMUL (due to the 0F opcode prefix)
    there's no suitable relocation, so the pre-APX forms cannot be marked
    for relaxation in the assembler.

"pushl main@GOT(%ebx)" in sysdeps/i386/start.S was assembled to

1c: ff b3 00 00 00 00 push 0x0(%ebx) 1e: R_386_GOT32X main

Linkers in binutils versions older than 2.45 treated it as jmp and relaxed
it to

22c: e9 cf ff ff ff   jmp    200 <main>
231: 90               nop

Update elf_i386_convert_load_reloc in binutils versions older than 2.45
to check MODRM for call and jmp to work with i386 glibc assembled with
binutils 2.45 or newer.  Do the same in elf_x86_64_convert_load_reloc.

PR ld/32991
* elf32-i386.c (elf_i386_convert_load_reloc): Check MODRM for
call and jmp.
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 452f5511154ca02095a271cf085e17f536587207)

10 months agolibctf: fix ref leak of names of newly-inserted non-root-visible types
Nick Alcock [Mon, 29 Jul 2024 11:45:09 +0000 (12:45 +0100)] 
libctf: fix ref leak of names of newly-inserted non-root-visible types

A bug in ctf_dtd_delete led to refs in the string table to the
names of non-root-visible types not being removed when the DTD
was.  This seems harmless, but actually it would lead to a write
down a pointer into freed memory if such a type was ctf_rollback()ed
over and then the dict was serialized (updating all the refs as the
strtab was serialized in turn).

Bug introduced in commit fe4c2d55634c700ba527ac4183e05c66e9f93c62
("libctf: create: non-root-visible types should not appear in name tables")
which is included in binutils 2.35.

libctf/
* ctf-create.c (ctf_dtd_delete): Remove refs for all types
with names, not just root-visible ones.

22 months agoPR30697, ppc32 mix of local-dynamic and global-dynamic TLS
Alan Modra [Fri, 4 Aug 2023 05:39:53 +0000 (15:09 +0930)] 
PR30697, ppc32 mix of local-dynamic and global-dynamic TLS

This fixes miscounting of dynamic relocations on GOT entries when
a) there are both local-dynamic and global-dynamic tls accesss for a
   given symbol, and
b) the symbol is global with non-default visibility, and
c) the __tls_get_addr calls aren't optimised away.

PR 30697
bfd/
* elf32-ppc.c (allocate_dynrelocs): Correct local-dynamic
reloc count.
ld/
* testsuite/ld-powerpc/tls32ldgd.d,
* testsuite/ld-powerpc/tls32ldgd.s: New test.
* testsuite/ld-powerpc/powerpc.exp: Run it.

(cherry picked from commit ae33771224660dac25e64c3f70943a17bfab7681)

2 years agoelf: Reset alignment for each PT_LOAD segment
H.J. Lu [Mon, 1 Aug 2022 23:02:39 +0000 (16:02 -0700)] 
elf: Reset alignment for each PT_LOAD segment

Reset alignment for each PT_LOAD segment to avoid using alignment from
the previous PT_LOAD segment.

bfd/

PR ld/29435
* elf.c (assign_file_positions_for_load_sections): Reset
alignment for each PT_LOAD segment.

ld/

PR ld/29435
* testsuite/ld-elf/pr29435.d: New file.
* testsuite/ld-elf/pr29435.s: Likewise.

(cherry picked from commit 59f214544c50ec7ebbca285ff2b4949f48671690)

2 years agoRe: PowerPC64 pcrel got relocs against local symbols
Alan Modra [Tue, 20 Sep 2022 23:36:29 +0000 (09:06 +0930)] 
Re: PowerPC64 pcrel got relocs against local symbols

The last patch wasn't all that shiny.  There are rather a lot more
relocations that can hit the assertion in md_apply_fix if the symbol
is local or absolute.  Fix them all.

* config/tc-ppc.c (ppc_force_relocation): Add all relocs that
expect a symbol in md_apply_fix.  Remove tls pcrel relocs
already covered in general tls match range.

(cherry picked from commit 8b168f1a1e09e337d2a970f204a0230c091bbe58)

2 years agoPowerPC64 pcrel got relocs against local symbols
Alan Modra [Fri, 16 Sep 2022 08:38:44 +0000 (18:08 +0930)] 
PowerPC64 pcrel got relocs against local symbols

Not that anyone would want to indirect via the GOT when an address can
be loaded directly with pla, the following:

 pld 3,x@got@pcrel
x:

leads to "Internal error in md_apply_fix", because the generic parts
of assembler fixup handling convert the fx_pcrel fixup to one without
a symbol.  Stop that happening.

* config/tc-ppc.c (ppc_force_relocation): Add PLT_PCREL34 and
assorted GOT_PCREL34 relocs.

(cherry picked from commit 49c3ed081fed6b8e2b48fdc48f805f11e4589514)

2 years agoi386: Don't allow GOTOFF relocation against IFUNC symbol for PIC
H.J. Lu [Thu, 21 Jul 2022 17:35:58 +0000 (10:35 -0700)] 
i386: Don't allow GOTOFF relocation against IFUNC symbol for PIC

We can't use the PLT entry as the function address for PIC since the PIC
register may not be set up properly for indirect call.

bfd/

PR ld/27998
* elf32-i386.c (elf_i386_relocate_section): Don't allow GOTOFF
relocation against IFUNC symbol for PIC.

ld/

PR ld/27998
* testsuite/ld-i386/pr27998a.d: Replace -shared with -e bar.
* testsuite/ld-i386/pr27998b.d: Expect a linker error.
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Updated.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-i386.s: Replace @GOTOFF with @GOT.
* testsuite/ld-ifunc/ifunc-2-local-i386.s: Likewise.

(cherry picked from commit 8f29211c3f0a6335c17e0a90396c146facf6dba4)

2 years agox86: Properly check invalid relocation against protected symbol
H.J. Lu [Mon, 18 Jul 2022 18:44:32 +0000 (11:44 -0700)] 
x86: Properly check invalid relocation against protected symbol

Only check invalid relocation against protected symbol defined in shared
object.

bfd/

PR ld/29377
* elf32-i386.c (elf_i386_scan_relocs): Only check invalid
relocation against protected symbol defined in shared object.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.

ld/

PR ld/29377
* testsuite/ld-elf/linux-x86.exp: Run PR ld/29377 tests.
* testsuite/ld-elf/pr29377a.c: New file.
* testsuite/ld-elf/pr29377b.c: Likewise.

(cherry picked from commit bd0736124c20950ac353f01e5029b7cb5d8a7010)

ld: Pass -nostdlib to compiler with -r

Pass -nostdlib to compiler with -r to avoid unnecessary .o file and
libraries.

PR ld/29377
* testsuite/ld-elf/linux-x86.exp: Pass -nostdlib with -r.

(cherry picked from commit 76e4fa70e79ee959c0e11eaacd4cf863291b1ddb)

2 years agoAutomatic date update in version.in
GDB Administrator [Fri, 8 Jul 2022 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Thu, 7 Jul 2022 00:01:11 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Wed, 6 Jul 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Tue, 5 Jul 2022 00:01:12 +0000 (00:01 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Mon, 4 Jul 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sun, 3 Jul 2022 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

2 years agoAutomatic date update in version.in
GDB Administrator [Sat, 2 Jul 2022 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 1 Jul 2022 00:01:27 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 30 Jun 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 29 Jun 2022 00:01:06 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agolibctf: tests: prune warnings from compiler output
Nick Alcock [Sat, 11 Jun 2022 12:07:18 +0000 (13:07 +0100)] 
libctf: tests: prune warnings from compiler output

We were failing to call prune_warnings appropriately, leading to
false-positive test failures on some platforms (observed on
sparclinux).

libctf/ChangeLog:

* testsuite/lib/ctf-lib.exp: Prune warnings from compiler and
linker output.
* testsuite/libctf-regression/libctf-repeat-cu.exp: Likewise,
and ar output too.

3 years agolibctf: fix linking together multiple objects derived from the same source
Nick Alcock [Fri, 10 Jun 2022 16:05:50 +0000 (17:05 +0100)] 
libctf: fix linking together multiple objects derived from the same source

Right now, if you compile the same .c input repeatedly with CTF enabled
and different compilation flags, then arrange to link all of these
together, then things misbehave in various ways.  libctf may conflate
either inputs (if the .o files have the same name, say if they are
stored in different .a archives), or per-CU outputs when conflicting
types are found: the latter can lead to entirely spurious errors when
it tries to produce multiple per-CU outputs with the same name
(discarding all but the last, but then looking for types in the earlier
ones which have just been thrown away).

Fixing this is multi-pronged.  Both inputs and outputs need to be
differentiated in the hashtables libctf keeps them in: inputs with the
same cuname and filename need to be considered distinct as long as they
have different associated CTF dicts, and per-CU outputs need to be
considered distinct as long as they have different associated input
dicts.  Right now there is nothing tying the two together other than the
CU name: fix this by introducing a new field in the ctf_dict_t named
ctf_link_in_out, which (for input dicts) points to the associated per-CU
output dict (if any), and for output dicts points to the associated
input dict.  At creation time the name used is completely arbitrary:
it's only important that it be distinct if CTF dicts are distinct.  So,
when a clash is found, adjust the CU name by sticking the number of
elements in the input on the end.  At output time, the CU name will
appear in the linked object, so it matters a little more that it look
slightly less ugly: in conflicting cases, append an incrementing
integer, starting at 0.

This naming scheme is not very helpful, but it's hard to see what else
we can do.  The input .o name may be the same.  The input .a name is not
even visible to ctf_link, and even *that* might be the same, because
.a's can contain many members with the same name, all of which
participate in the link.  All we really know is that the two have
distinct dictionaries with distinct types in them, and at least this way
they are all represented, any any symbols, variables etc referring to
those types are accurately stored.

(As a side-effect this also fixes a use-after-free and double-free when
errors are found during variable or symbol emission.)

Use the opportunity to prevent a couple of sources of problems, to wit
changing the active CU mappings when a link has already been done
(no effect on ld, which doesn't use CU mappings at all), and causing
multiple consecutive ctf_link's to have the same net effect as just
doing the last one (no effect on ld, which only ever does one
ctf_link) rather than having the links be a sort of half-incremental
not-really-intended mess.

libctf/ChangeLog:

PR libctf/29242
* ctf-impl.h (struct ctf_dict) [ctf_link_in_out]: New.
* ctf-dedup.c (ctf_dedup_emit_type): Set it.
* ctf-link.c (ctf_link_add_ctf_internal): Set the input
CU name uniquely when clashes are found.
(ctf_link_add): Document what repeated additions do.
(ctf_new_per_cu_name): New, come up with a consistent
name for a new per-CU dict.
(ctf_link_deduplicating): Use it.
(ctf_create_per_cu): Use it, and ctf_link_in_out, and set
ctf_link_in_out properly.  Don't overwrite per-CU dicts with
per-CU dicts relating to different inputs.
(ctf_link_add_cu_mapping): Prevent per-CU mappings being set up
if we already have per-CU outputs.
(ctf_link_one_variable): Adjust ctf_link_per_cu call.
(ctf_link_deduplicating_one_symtypetab): Likewise.
(ctf_link_empty_outputs): New, delete all the ctf_link_outputs
and blank out ctf_link_in_out on the corresponding inputs.
(ctf_link): Clarify the effect of multiple ctf_link calls.
Empty ctf_link_outputs if it already exists rather than
having the old output leak into the new link.  Fix a variable
name.
* testsuite/config/default.exp (AR): Add.
(OBJDUMP): Likewise.
* testsuite/libctf-regression/libctf-repeat-cu.exp: New test.
* testsuite/libctf-regression/libctf-repeat-cu*: Main program,
library, and expected results for the test.

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 28 Jun 2022 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 27 Jun 2022 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 26 Jun 2022 00:00:35 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 25 Jun 2022 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 24 Jun 2022 00:01:00 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoPowerPC64: fix assertion in ppc_build_one_stub with -Os code
Alan Modra [Thu, 23 Jun 2022 08:20:30 +0000 (17:50 +0930)] 
PowerPC64: fix assertion in ppc_build_one_stub with -Os code

save_res stubs aren't written in ppc_build_one_stub, their offsets
(which are zero) should not be checked.

* elf64-ppc.c (ppc_build_one_stub): Don't check save_res offsets.

(cherry picked from commit 570e911f4e533fad33ad5e4e1102929cf7e80bd7)

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 23 Jun 2022 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 22 Jun 2022 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 21 Jun 2022 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 20 Jun 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 19 Jun 2022 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 18 Jun 2022 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 17 Jun 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 16 Jun 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 15 Jun 2022 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 14 Jun 2022 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 13 Jun 2022 00:00:38 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 12 Jun 2022 00:00:39 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 11 Jun 2022 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 10 Jun 2022 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 9 Jun 2022 00:00:57 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 8 Jun 2022 00:00:43 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 7 Jun 2022 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 6 Jun 2022 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 5 Jun 2022 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 4 Jun 2022 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 3 Jun 2022 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 2 Jun 2022 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agox86: Properly handle IFUNC function pointer reference
H.J. Lu [Tue, 31 May 2022 22:38:19 +0000 (15:38 -0700)] 
x86: Properly handle IFUNC function pointer reference

Update

commit 68c4956b1401de70173848a6bdf620cb42fa9358
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Apr 26 09:08:54 2022 -0700

    x86: Properly handle function pointer reference

to properly handle IFUNC function pointer reference.  Since IFUNC symbol
value is only known at run-time, set pointer_equality_needed for IFUNC
function pointer reference in PDE so that it will be resolved to its PLT
entry directly.

bfd/

PR ld/29216
* elf32-i386.c (elf_i386_scan_relocs): Set pointer_equality_needed
for IFUNC function pointer reference in PDE.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.

ld/

PR ld/29216
* testsuite/ld-ifunc/ifunc.exp: Run PR ld/29216 test.
* testsuite/ld-ifunc/pr29216.c: New file.

(cherry picked from commit 98a1627f19ca125476d5d58d9999c7a8d381f403)

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 1 Jun 2022 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 31 May 2022 00:00:36 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 30 May 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 29 May 2022 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 28 May 2022 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 27 May 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 26 May 2022 00:00:41 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 25 May 2022 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 24 May 2022 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 23 May 2022 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 22 May 2022 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 May 2022 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 20 May 2022 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAArch64: Enable FP16 by default for Armv9-A.
Tamar Christina [Wed, 18 May 2022 09:37:10 +0000 (10:37 +0100)] 
AArch64: Enable FP16 by default for Armv9-A.

In Armv9-A SVE is mandatory, and for SVE FP16 is mandatory.  This fixes a disconnect
between GCC and binutils where GCC has FP16 on by default and gas doesn't.

include/ChangeLog:

2022-05-16  Tamar Christina  <tamar.christina@arm.com>

* opcode/aarch64.h (AARCH64_ARCH_V9_FEATURES): Add AARCH64_FEATURE_F16.

(cherry picked from commit e1e15284481896505eab0cbc556f2348ef8fffbf)
Signed-off-by: Tamar Christina <tamar.christina@arm.com>
3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 19 May 2022 00:00:53 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 18 May 2022 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 17 May 2022 00:01:15 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 16 May 2022 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 15 May 2022 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 14 May 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 13 May 2022 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoPR29142, segv in ar with empty archive and libdeps specified
Alan Modra [Thu, 12 May 2022 02:08:05 +0000 (11:38 +0930)] 
PR29142, segv in ar with empty archive and libdeps specified

PR 29142
* ar.c (main): Properly handle libdeps for zero file_count.

(cherry picked from commit fa445221958a9b8c8c4a804a339bc54cedfd83b9)

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 12 May 2022 00:00:47 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 11 May 2022 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 10 May 2022 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoM68K: avoid quadratic slowdlow in label alignment check
Sergei Trofimovich [Thu, 14 Apr 2022 07:47:00 +0000 (08:47 +0100)] 
M68K: avoid quadratic slowdlow in label alignment check

Before the change tc-m68k maintained a list of seen labels.
Alignment check traversed label list to resolve symbol to label.
This caused quadratic slowdown as each symbol was checked against
each label. Worst affected files are the ones built with debugging
enabled as DWARF generates many labels.

The change embeds auxiliary label information right into symbol using
TC_SYMFIELD_TYPE.

Before the change test from PR 29058 did not finish in 10 minutes. After
the change it finishes in 2 seconds.

gas/ChangeLog:

PR 29058
* config/tc-m68k.h (TC_SYMFIELD_TYPE): define as m68k_tc_sy.
* config/tc-m68k.c (m68k_frob_label): Use TC_SYMFIELD_TYPE to
store label information.

(cherry picked from commit c641fe0dcb886dc1b8a235ab2b236275ee46510a)

3 years agoAdjust ld ctf test for 32-bit targets
Alan Modra [Fri, 25 Feb 2022 06:55:26 +0000 (17:25 +1030)] 
Adjust ld ctf test for 32-bit targets

powerpc-linux, and I suspect other 32-bit targets, report "aligned at
0x4" for this test.

* testsuite/ld-ctf/nonrepresentable.d: Accept any alignment.

(cherry picked from commit db120fb808dc24538e89b851d6dda1890aad5a1f)

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 9 May 2022 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 8 May 2022 00:01:01 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 7 May 2022 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 6 May 2022 00:00:58 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 5 May 2022 00:00:40 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 4 May 2022 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 3 May 2022 00:00:59 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 2 May 2022 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 1 May 2022 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 30 Apr 2022 00:00:42 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 29 Apr 2022 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agox86: Properly handle function pointer reference
H.J. Lu [Tue, 26 Apr 2022 16:08:54 +0000 (09:08 -0700)] 
x86: Properly handle function pointer reference

Update

commit ebb191adac4ab45498dec0bfaac62f0a33537ba4
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Feb 9 15:51:22 2022 -0800

    x86: Disallow invalid relocation against protected symbol

to allow function pointer reference and make sure that PLT entry isn't
used for function reference due to function pointer reference.

bfd/

PR ld/29087
* elf32-i386.c (elf_i386_scan_relocs): Don't set
pointer_equality_needed nor check non-canonical reference for
function pointer reference.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Likewise.

ld/

PR ld/29087
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/29087 tests.
* testsuite/ld-x86-64/protected-func-3.c: New file.

(cherry picked from commit 68c4956b1401de70173848a6bdf620cb42fa9358)

3 years agos390: Add DT_JMPREL pointing to .rela.[i]plt with static-pie
Stefan Liebler [Thu, 28 Apr 2022 12:30:55 +0000 (14:30 +0200)] 
s390: Add DT_JMPREL pointing to .rela.[i]plt with static-pie

In static-pie case, there are IRELATIVE-relocs in
.rela.iplt (htab->irelplt), which will later be grouped
to .rela.plt.  On s390, the IRELATIVE relocations are
always located in .rela.iplt - even for non-static case.
Ensure that DT_JMPREL, DT_PLTRELA, DT_PLTRELASZ is added
to the dynamic section even if htab->srelplt->size == 0.
See _bfd_elf_add_dynamic_tags in bfd/elflink.c.

bfd/
elf64-s390.c (elf_s390_size_dynamic_sections):
Enforce DT_JMPREL via htab->elf.dt_jmprel_required.

(cherry picked from commit d942d8db12adf4c9e5c7d9ed6496a779ece7149e)

3 years agos390: Avoid dynamic TLS relocs in PIE
Stefan Liebler [Thu, 28 Apr 2022 12:29:58 +0000 (14:29 +0200)] 
s390: Avoid dynamic TLS relocs in PIE

No dynamic relocs are needed for TLS defined in an executable, the
TP relative offset is known at link time.

Fixes
FAIL: Build pr22263-1

bfd/
PR ld/22263
* elf64-s390.c (elf_s390_tls_transition): Use bfd_link_dll
instead of bfd_link_pic for TLS.
(elf_s390_check_relocs): Likewise.
(allocate_dynrelocs): Likewise.
(elf_s390_relocate_section): Likewise.

(cherry picked from commit 26b1426577b5dcb32d149c64cca3e603b81948a9)

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 28 Apr 2022 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 27 Apr 2022 00:00:55 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 26 Apr 2022 00:00:50 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Mon, 25 Apr 2022 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sun, 24 Apr 2022 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Sat, 23 Apr 2022 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Fri, 22 Apr 2022 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Thu, 21 Apr 2022 00:00:54 +0000 (00:00 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Wed, 20 Apr 2022 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

3 years agoAutomatic date update in version.in
GDB Administrator [Tue, 19 Apr 2022 00:00:57 +0000 (00:00 +0000)] 
Automatic date update in version.in