Age | Commit message (Collapse) | Author | Files | Lines |
|
A default versioned symbol definition in a shared library is
overridden by an unversioned definition in a regular object file, and
thus should not be reason to make an as-needed library needed.
bfd/
PR 27311
* elflink.c (_bfd_elf_add_default_symbol): Add override parameter.
Use when handling default versioned symbol. Rename existing
override variable to nondef_override and use for non-default
versioned symbol.
(elf_link_add_object_symbols): Adjust call to suit. Don't
pull in as-needed libraries when override is set.
ld/
* testsuite/ld-plugin/pr27311.d,
* testsuite/ld-plugin/pr27311.ver,
* testsuite/ld-plugin/pr27311a.c,
* testsuite/ld-plugin/pr27311b.c,
* testsuite/ld-plugin/pr27311c.c: New testcase.
* testsuite/ld-plugin/lto.exp: Run it. Correct PR14918 and
PR12982 entries.
|
|
* configure.tgt: Add *-*-genode* as a target for AArch64 and x86.
|
|
This makes --defsym support the same expressions as assignment in a
script. For example, --defsym 'HIDDEN(foo=0)', will define a hidden
visibility foo.
* ldgram.y (defsym_expr): Use assignment rule.
* ldlex.h (ldlex_defsym): Delete.
* ldlex.l (DEFSYMEXP, ldlex_defsym): Delete.
|
|
Parsing symbol or file/section names in ld linker scripts is a little
complicated. Inside SECTIONS, a name might be the start of an
expression or an output section. Is ".foo=x-y" a fancy section name
or is it the expression ".foo = x - y"? It isn't possible for a
single lookahead parser to decide, so the answer in this case is
that it's a section name. This is the reason why everyone writes
linker script assignment expressions with lots of white-space.
However, there are many places where the parser knows for sure that an
expression is expected. Those could be written without whitespace
given the first change to ldlex.l below. Unfortunately, that runs
into a lookahead problem. Optional expressions at the end of an
output section statement require the parser to look ahead one token in
expression context. For this example from standard scripts
.interp : { *(.interp) }
.note.gnu.build-id : { *(.note.gnu.build-id) }
at the end of the .interp closing brace, the parser is looking for
a possible memspec, phdr, fill or even an optional comma. The next
token is a NAME, but in expression context that NAME now doesn't
include '-' as a valid char. So the lookahead NAME is
".note.gnu.build" with an unexpected "-id" syntax error before the
colon. The rest of the patch involving ldlex_backup arranges to
discard that NAME token so that it will be rescanned in the proper
script context.
* ldgram.y (section): Call ldlex_backup. Remove empty action.
* ldlex.h (ldlex_backup): Declare.
* ldlex.l (<EXPRESSION>NAME): Don't use NOCFILENAMECHAR set of
chars, use SYMBOLNAMECHAR.
(ldlex_backup): New function.
|
|
Beginning a new rule hidden inside another rule is horrible.
* ldgram.y: Whitespace fixes.
|
|
* testsuite/ld-elf/pr27259.d: Correct sh_link match.
|
|
bfd/
PR 27271
* elflink.c (bfd_elf_link_record_dynamic_symbol): Don't segfault
on symbols defined in absolute or other special sections.
ld/
* testsuite/ld-tic6x/tic6x.exp: Add pr27271 test.
|
|
PR ld/27259
* testsuite/ld-elf/pr27259.d: New file.
* testsuite/ld-elf/pr27259.s: Likewise.
|
|
This stops ld from endless looping on SHF_LINK_ORDER sh_link loops.
bfd/
PR 27259
* elflink.c (_bfd_elf_gc_mark_extra_sections): Use linker_mark to
prevent endless looping of linked-to sections.
ld/
PR 27259
* ldelf.c (ldelf_before_place_orphans): Use linker_mark to
prevent endless looping of linked-to sections.
|
|
Pass -mx86-used-note=no to assembler.
* testsuite/ld-x86-64/bnd-plt-1.d: Fix a typo.
|
|
This makes it possible to build ld without any compiled-in scripts,
by setting COMPILE_IN=no in the environment. pe, beos and pdp11
targets didn't support scripts from the file system, with pdp11
nastily editing the ld/ldscripts file so that the built-in script
didn't match.
PR 27226
* emulparams/alphavms.sh: Don't set COMPILE_IN.
* emulparams/elf64_ia64_vms.sh: Likewise.
* emulparams/elf64mmix.sh: Likewise.
* emulparams/elf_iamcu.sh: Likewise.
* emulparams/elf_k1om.sh: Likewise.
* emulparams/elf_l1om.sh: Likewise.
* emulparams/mmo.sh: Likewise.
* emulparams/pdp11.sh: Set DATA_SEG_ADDR.
* scripttempl/pdp11.sc: Use it.
* emultempl/pdp11.em: Don't edit .xn script for separate_code,
instead use .xe script. Support scripts from file system.
* emultempl/beos.em: Support scripts from file system.
* emultempl/pe.em: Likewise.
* emultempl/pep.em: Likewise.
* testsuite/ld-bootstrap/bootstrap.exp: Make tmpdir/ldscripts link.
|
|
|
|
* scripttempl/DWARF.sc: Add .debug_loclists, .debug_rnglists,
.debug_line_str and .debug_str_offsets. Move .debug_macro and
.debug_addr into DWARF-5 section.
|
|
git commit 994b25132814 "Ignore section symbols when matching linkonce
with comdat" cured the reason why this test used to fail on mips.
* testsuite/ld-elf/pr26936.d: No longer xfail mips.
|
|
PowerPC version of git commit d1bcae833b.
bfd/
* elf32-ppc.c: Delete outdated comment.
(TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define.
* elf64-ppc.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): Define.
gas/
* testsuite/gas/ppc/power4.d: Adjust for removal of section sym.
* testsuite/gas/ppc/test1elf32.d: Likewise.
* testsuite/gas/ppc/test1elf64.d: Likewise.
ld/
* testsuite/ld-powerpc/relbrlt.s: Make symbols global.
* testsuite/ld-powerpc/relbrlt.d: Adjust to suit.
* testsuite/ld-powerpc/tlsget.d: Adjust for reordered stubs.
* testsuite/ld-powerpc/tlsget.wf: Likewise.
* testsuite/ld-powerpc/tlsget2.d: Likewise.
* testsuite/ld-powerpc/tlsget2.wf: Likewise.
* testsuite/ld-powerpc/tlsexe.r: Adjust for removed section syms.
* testsuite/ld-powerpc/tlsexe32.r: Likewise.
* testsuite/ld-powerpc/tlsexe32no.r: Likewise.
* testsuite/ld-powerpc/tlsexeno.r: Likewise.
* testsuite/ld-powerpc/tlsexenors.r: Likewise.
* testsuite/ld-powerpc/tlsexers.r: Likewise.
* testsuite/ld-powerpc/tlsexetoc.r: Likewise.
* testsuite/ld-powerpc/tlsexetocrs.r: Likewise.
* testsuite/ld-powerpc/tlsso.r: Likewise.
* testsuite/ld-powerpc/tlsso32.r: Likewise.
* testsuite/ld-powerpc/tlstocso.r: Likewise.
|
|
GCC 11+ spots that the extern var_1 and var_666 declarations in this
test are unused, and removes them, thus stopping them from appearing as
conflicted data symbols and rendering the test pointless. Use them in a
function unique to this TU to prevent them from being eliminated.
ld/ChangeLog
2021-01-19 Nick Alcock <nick.alcock@oracle.com>
* testsuite/ld-ctf/data-func-2.c: Stop removal of the extern foo_t
symbols by the optimizer.
* testsuite/ld-ctf/data-func-conflicted.d: Adjust accordingly.
|
|
The sizes of compressed and uncompressed .debug_aranges are the same
for the riscv big endian targets, but different for the little endian
targets. The compress rule is fine and isn't broken by riscv, just the
original compressed1d.d fails by accident. Ideally, we should fill the
R_RISCV_ADD/SUB relocations when disabling relaxations in the assembler.
But before that, Jim already had written an alternative test compressed1d-alt
to relpace compressed1d.d for riscv, so we can only xfail the riscv little
endian targets in the short-term.
ld/
* testsuite/ld-elf/elf.exp (riscv_little_endian): Added. Return true
if target is riscv little endian. Otherwise, return false.
* testsuite/ld-elf/compressed1d.d: Only xfail the riscv little endian
targets by [riscv_little_endian].
|
|
This changes the initialisation of output sections so that it is
possible to create read-only sections fed only from linker script
BYTE, SHORT, LONG or QUAD. That currently isn't possible even for one
of the well-known ELF sections like .rodata, because once a section is
marked read/write that sticks. On the other hand if we start
read-only, well-known ELF sections end up read/write as appropriate.
For example .tdata will still be SHF_ALLOC + SHF_WRITE + SHF_TLS.
PR 26378
* ldlang.c (map_input_to_output_sections): Start with a read-only
section for data statements.
* testsuite/ld-elf/size-2.d: Adjust to suit.
|
|
When deciding if a single member comdat group section in file FOO should
be discarded by a linkonce section in file BAR, we check if 2 sections
define the same set of local and global symbols. When only one of the
files doesn't contain the unused section symbols in the symbol table,
such as object files generated by clang or GNU assembler with
commit d1bcae833b32f1408485ce69f844dcd7ded093a8
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Jan 7 06:42:00 2021 -0800
ELF: Don't generate unused section symbols
the check will fail since one file has the extra unused section symbols.
We should ignore both undefined and section symbols in the symbol table
when making such a decision.
bfd/
PR ld/27193
* elflink.c (elf_create_symbuf): Also ignore section symbols.
ld/
PR ld/27193
* testsuite/ld-i386/i386.exp: Run PR ld/27193 test.
* testsuite/ld-i386/pr27193.dd: New file.
* testsuite/ld-i386/pr27193a.o.bz2: Likewise.
* testsuite/ld-i386/pr27193b.s: Likewise.
|
|
Increase the max number of open files to 20 for PR binutils/23460 test
which may have more than 16 file descriptors open:
lr-x------ 1 hjl hjl 64 Jan 16 16:49 0 -> /dev/null
l-wx------ 1 hjl hjl 64 Jan 16 16:49 1 -> pipe:[14151430]
lr-x------ 1 hjl hjl 64 Jan 16 16:49 10 -> /export/build/gnu/tools-build/x86_64-linux-toolchain/build-x86_64-linux/binutils/src/binutils-build/ld/tmpdir/pr23460c.o
lr-x------ 1 hjl hjl 64 Jan 16 16:49 11 -> /export/build/gnu/tools-build/x86_64-linux-toolchain/build-x86_64-linux/binutils/src/binutils-build/ld/tmpdir/pr23460d.o
lr-x------ 1 hjl hjl 64 Jan 16 16:49 12 -> /export/build/gnu/tools-build/x86_64-linux-toolchain/build-x86_64-linux/binutils/src/binutils-build/ld/tmpdir/pr23460e.o
lr-x------ 1 hjl hjl 64 Jan 16 16:49 13 -> /export/build/gnu/tools-build/x86_64-linux-toolchain/build-x86_64-linux/binutils/src/binutils-build/ld/tmpdir/pr23460f.o
lrwx------ 1 hjl hjl 64 Jan 16 16:49 14 -> /export/build/gnu/tools-build/x86_64-linux-toolchain/build-x86_64-linux/binutils/src/binutils-build/ld/tmpdir/stTLiXpO
lrwx------ 1 hjl hjl 64 Jan 16 16:49 15 -> /export/build/gnu/tools-build/x86_64-linux-toolchain/build-x86_64-linux/binutils/src/binutils-build/ld/tmpdir/stTLiXpO
l-wx------ 1 hjl hjl 64 Jan 16 16:49 2 -> pipe:[14151430]
lr-x------ 1 hjl hjl 64 Jan 16 16:49 3 -> pipe:[13933216]
l-wx------ 1 hjl hjl 64 Jan 16 16:49 4 -> pipe:[13933216]
lr-x------ 1 hjl hjl 64 Jan 16 16:49 5 -> pipe:[13990857]
l-wx------ 1 hjl hjl 64 Jan 16 16:49 6 -> pipe:[13990857]
lr-x------ 1 hjl hjl 64 Jan 16 16:49 7 -> /export/build/gnu/tools-build/x86_64-linux-toolchain/build-x86_64-linux/binutils/src/binutils-build/ld/tmpdir/libpr23460.a
lr-x------ 1 hjl hjl 64 Jan 16 16:49 8 -> /export/build/gnu/tools-build/x86_64-linux-toolchain/build-x86_64-linux/binutils/src/binutils-build/ld/tmpdir/pr23460a.o
lr-x------ 1 hjl hjl 64 Jan 16 16:49 9 -> /export/build/gnu/tools-build/x86_64-linux-toolchain/build-x86_64-linux/binutils/src/binutils-build/ld/tmpdir/pr23460b.o
PR binutils/23460
* testsuite/ld-plugin/lto.exp: Increase the max number of open
files to 20 for PR binutils/23460 test.
|
|
On x86, glibc 2.33 starts to issue a fatal error message when calling
IFUNC function defined in the unrelocated executable from a shared
library.
1. Update x86 ELF linker to always convert IFUNC function defined in
position-dependent executable (PDE) to the normal function. GOT in PDE
will be updated by R_*_IRELATIVE at run-time.
2. Update PR ld/23169 tests not to compare function address of external
IFUNC function in the shared object to avoid calling the IFUNC function
defined in the unrelocated executable.
3. Remove pr23169e tests which call the IFUNC function defined in the
unrelocated position-independent executable from a shared library.
bfd/
PR ld/23169
* elfxx-x86.c (_bfd_x86_elf_link_fixup_ifunc_symbol): Don't
check pointer_equality_needed.
ld/
PR ld/23169
* testsuite/ld-ifunc/ifunc.exp: Replace pr23169c.rd with
pr23169a.rd for pr23169c and pr23169f. Remove pr23169e tests.
* testsuite/ld-ifunc/pr23169a.c (foo): Don't compare function
address.
|
|
Linker generated relative relocations don't have symbol info:
[hjl@gnu-cfl-2 tmpdir]$ readelf -rW dump
Relocation section '.rela.dyn' at offset 0x180 contains 2 entries:
Offset Info Type Sym. Value Symbol's Name + Addend
00002f70 00000008 R_X86_64_RELATIVE 1000
00002f68 00000025 R_X86_64_IRELATIVE 1007
[hjl@gnu-cfl-2 tmpdir]$
Add -z report-relative-reloc to x86 ELF linker to report dynamic relative
relocations:
[hjl@gnu-cfl-2 tmpdir]$ ../ld-new -pie -melf32_x86_64 -z report-relative-reloc -o dump report-reloc-1.o
dump: R_X86_64_IRELATIVE (offset: 0x00002f68, info: 0x00000025, addend: 0x00001007) against 'ifunc' for section '.data.rel.ro.local' in report-reloc-1.o
dump: R_X86_64_RELATIVE (offset: 0x00002f70, info: 0x00000008, addend: 0x00001000) against '_start' for section '.data.rel.ro.local' in report-reloc-1.o
[hjl@gnu-cfl-2 tmpdir]$
It can be used to map relative relocations to corresponding symbols.
bfd/
* elf-linker-x86.h (elf_linker_x86_params): Add
report_relative_reloc.
* elf32-i386.c (elf_i386_relocate_section): Call
_bfd_x86_elf_link_report_relative_reloc to report relative
relocations for -z report-relative-reloc.
(elf_i386_finish_dynamic_symbol): Likewse.
* elf64-x86-64.c (elf_x86_64_relocate_section): Likewse.
(elf_x86_64_finish_dynamic_symbol): Likewse.
* elfxx-x86.c (_bfd_x86_elf_link_report_relative_reloc): New
function.
* elfxx-x86.h (_bfd_x86_elf_link_report_relative_reloc): New
prototype.
ld/
* NEWS: Mention -z report-relative-reloc.
* ld.texi: Document -z report-relative-reloc.
* emulparams/elf32_x86_64.sh: Source x86-report-relative.sh.
* emulparams/elf_i386.sh: Likewse.
* emulparams/elf_x86_64.sh: Likewse.
* emulparams/x86-report-relative.sh: New file.
* testsuite/ld-i386/report-reloc-1.d: Likewse.
* testsuite/ld-i386/report-reloc-1.l: Likewse.
* testsuite/ld-i386/report-reloc-1.s: Likewse.
* testsuite/ld-x86-64/report-reloc-1-x32.d: Likewse.
* testsuite/ld-x86-64/report-reloc-1.d: Likewse.
* testsuite/ld-x86-64/report-reloc-1.l: Likewse.
* testsuite/ld-x86-64/report-reloc-1.s: Likewse.
* testsuite/ld-i386/i386.exp: Run report-reloc-1.
* testsuite/ld-x86-64/x86-64.exp: Run report-reloc-1 and
report-reloc-1-x32.
|
|
This patch makes undefined unversioned dynamic symbols use
VER_NDX_GLOBAL (version 1) rather than VER_NDX_LOCAL (version 0).
There really isn't much use for an undefined local dynamic symbol, so
we may as well use the logically correct value in .gnu.version.
https://docs.oracle.com/cd/E26505_01/html/E26506/chapter6-54676.html
bfd/
PR 26002
* elflink.c (elf_link_output_extsym): Use version 1 in
.gnu.version for undefined unversioned symbols.
ld/
PR 26002
* testsuite/ld-elfvers/vers6.dsym: Expect "Base" for undefined
unversioned symbols.
* testsuite/ld-elfvers/vers16.dsym: Likewise.
|
|
Error and warning messages usually starting with lower case letter,
and without the period at the end. Besides, add the prefixed "internel:"
at the beginning of the messages when they are caused internally.
Also fix indents and typos.
bfd/
* elfnn-riscv.c (riscv_merge_attributes): Fix typos of messages.
gas/
* config/tc-riscv.c: Error and warning messages tidy.
* testsuite/gas/riscv/priv-reg-fail-fext.l: Updated.
* testsuite/gas/riscv/priv-reg-fail-read-only-01.l: Likewise.
* testsuite/gas/riscv/priv-reg-fail-read-only-02.l: Likewise.
* testsuite/gas/riscv/priv-reg-fail-rv32-only.l: Likewise.
* testsuite/gas/riscv/priv-reg-fail-version-1p10.l: Likewise.
* testsuite/gas/riscv/priv-reg-fail-version-1p11.l: Likewise.
* testsuite/gas/riscv/priv-reg-fail-version-1p9p1.l: Likewise.
ld/
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Updated.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Likewise.
* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Likewise.
opcodes/
* riscv-dis.c (parse_riscv_dis_option): Fix typos of message.
|
|
|
|
The Blackfin ELF compiler requires the user to explicitly select a CPU
target else it will fail:
bfin-elf-gcc: error: no processor type specified for linking
Select the sim target for these tests since we should (hopefully) have
access to the simulator. At least, it's more likely than having access
to a real development board.
This makes the pass/fail numbers increase by a lot:
-# of expected passes 398
-# of unexpected failures 6
+# of expected passes 587
+# of unexpected failures 109
It looks like the vast majority of new failures are due to our omission
of COPY relocations:
/* Bfin does not currently have a COPY reloc. */
if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
{
_bfd_error_handler (_("the bfin target does not currently support the generation of copy relocations"));
return FALSE;
}
There doesn't seem to be a way to easily disable tests that cause copy
relocations though, lets just take the hit for now.
* testsuite/config/default.exp [bfin*-elf*] (gcc_B_opt): Append -msim.
|
|
PR 27160
* ldelfgen.c (compare_link_order): Protect access of ELF section
data.
(add_link_order_input_section): Remove redundant NULL check.
Use bfd_get_flavour.
(ldelf_map_segments): Use bfd_get_flavour.
|
|
commit b209b5a6b8a accesses ELF section data without checking if input is
ELF. It caused:
sh: line 1: 1355479 Segmentation fault (core dumped) /export/build/gnu/tools-build/binutils-gitlab-x32/build-x86_64-linux-gnux32/ld/ld-new -o tmpdir/pe-x86-64-1 -z norelro -L/export/gnu/import/git/gitlab/x86-binutils/ld/testsuite/ld-x86-64 -m elf_x86_64 --entry=begin tmpdir/pe-x86-64-1a.obj tmpdir/pe-x86-64-1b.obj tmpdir/pe-x86-64-1c.obj 2>&1
FAIL: Build pe-x86-64-1
on Linux/x86-64 with PE/x86-64 inputs. Add check for ELF input before
accessing ELF section data.
* ldelfgen.c (add_link_order_input_section): Check for ELF input
before accessing ELF section data.
|
|
bfd/
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
binutils/
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
gas/
* Makefile.in: Regenerate.
* Makefile.in: Regenerate.
gprof/
* Makefile.in: Regenerate.
ld/
* Makefile.in: Regenerate.
libctf/
* Makefile.in: Regenerate.
opcodes/
* Makefile.in: Regenerate.
|
|
This moves the SHF_LINK_ORDER sorting from bfd_elf_final_link to
the linker which means generic ELF targets now support SHF_LINK_ORDER
and we cope with odd cases that require resizing of output sections.
The patch also fixes two bugs in the current implementation,
introduced by commit cd6d537c48fa. The pattern test used by that
commit meant that sections matching something like
"*(.IA_64.unwind* .gnu.linkonce.ia64unw.*)" would not properly sort a
mix of sections matching the two wildcards. That commit also assumed
a stable qsort.
bfd/
PR 27160
* section.c (struct bfd_section): Remove pattern field.
(BFD_FAKE_SECTION): Adjust to suit.
* bfd-in2.h: Regenerate.
* elflink.c (compare_link_order, elf_fixup_link_order): Delete.
(bfd_elf_final_link): Don't call elf_fixup_link_order.
ld/
PR 27160
* ldlang.h (lang_output_section_statement_type): Add data field.
(lang_input_section_type, lang_section_bst_type): Add pattern field.
(statement_list): Declare.
(lang_add_section): Adjust prototype.
* emultempl/aarch64elf.em: Adjust lang_add_section calls.
* emultempl/armelf.em: Likewise.
* emultempl/beos.em: Likewise.
* emultempl/cskyelf.em: Likewise.
* emultempl/hppaelf.em: Likewise.
* emultempl/m68hc1xelf.em: Likewise.
* emultempl/metagelf.em: Likewise.
* emultempl/mipself.em: Likewise.
* emultempl/mmo.em: Likewise.
* emultempl/msp430.em: Likewise.
* emultempl/nios2elf.em: Likewise.
* emultempl/pe.em: Likewise.
* emultempl/pep.em: Likewise.
* emultempl/ppc64elf.em: Likewise.
* emultempl/spuelf.em: Likewise.
* emultempl/vms.em: Likewise.
* ldelf.c: Likewise.
* ldelfgen.c: Include ldctor.h.
(struct os_sections): New.
(add_link_order_input_section, link_order_scan): New functions.
(compare_link_order, fixup_link_order): New functions.
(ldelf_map_segments): Call link_order_scan and fixup_link_order.
* ldlang.c (statement_list): Make global.
(output_section_callback_fast): Save pattern in tree node.
(lang_add_section): Add pattern parameter, save in lang_input_section.
(output_section_callback_tree_to_list): Adjust lang_add_section calls.
(lang_insert_orphan, output_section_callback): Likewise.
(ldlang_place_orphan): Likewise.
(gc_section_callback): Don't set section->pattern
* testsuite/ld-elf/pr26256-2a.d: Don't xfail generic.
* testsuite/ld-elf/pr26256-3b.d: Likewise.
* testsuite/ld-elf/pr26256-2b.d: Likewise. notarget xgate.
|
|
* ldlang.h (callback_t): Remove flag_info function parameter.
* ldlang.c (walk_wild_consider_section): Adjust to suit.
(walk_wild_section_general): Likewise.
(output_section_callback_fast, output_section_callback): Likewise.
(check_section_callback, gc_section_callback): Likewise.
(find_relro_section_callback): Likewise.
|
|
Compiling binutils using -flto=jobserver with GCC 11 leads to
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wwrite-strings -I../../gas/../zlib -g -O2 -fprofile-generate -flto=jobserver -o as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o config/tc-i386.o config/obj-elf.o config/atof-ieee.o ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a -L/tmp/binutils-gdb/objdir/zlib -lz ../libiberty/libiberty.a -ldl
lto-wrapper: warning: jobserver is not available: '--jobserver-auth=' is not present in 'MAKEFLAGS'
since the '+' is missing on the recipe line in Makefiles generated by
automake. Add the '+' to the recipe line by hand.
bfd/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
binutils/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
config/
PR binutils/26792
* jobserver.m4: New file.
gas/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
gprof/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
ld/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
libctf/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
opcodes/
PR binutils/26792
* configure.ac: Use GNU_MAKE_JOBSERVER.
* aclocal.m4: Regenerated.
* configure: Likewise.
|
|
Subtract the value of the section contents for R_AMD64_DIR64 and
R_AMD64_DIR32 relocations when generating ELF output from PE/x86-64
inputs.
bfd/
PR ld/27171
* reloc.c (bfd_perform_relocation): Adjust R_AMD64_DIR64 and
R_AMD64_DIR32 relocations for PE/x86-64 inputs.
ld/
PR ld/27171
* testsuite/ld-x86-64/pe-x86-64-5.obj.bz2: New file.
* testsuite/ld-x86-64/pe-x86-64-5.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-5.rd: Likewise.
* testsuite/ld-x86-64/pe-x86-64.exp: Run PR ld/27171 test.
|
|
Check if AR works with --plugin and rc before passing --plugin to AR and
RANLIB.
bfd/
PR ld/27173
binutils/
PR ld/27173
* configure: Regenerated.
gas/
PR ld/27173
* configure: Regenerated.
gprof/
PR ld/27173
* configure: Regenerated.
ld/
PR ld/27173
* configure: Regenerated.
libctf/
PR ld/27173
* configure: Regenerated.
opcodes/
PR ld/27173
* configure: Regenerated.
|
|
PR ld/27167
* ldmain.c (get_emulation): Add mipsmips32r3, mips32r5, mips64r3
and mips64r5 to list of known mips targets.
|
|
|
|
Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO
build.
bfd/
* configure: Regenerated.
binutils/
* configure: Regenerated.
gas/
* configure: Regenerated.
gprof/
* configure: Regenerated.
ld/
* configure: Regenerated.
libctf/
* configure: Regenerated.
opcodes/
* configure: Regenerated.
|
|
Properly merge GNU properties for LAM_U48 and LAM_U57.
bfd/
PR ld/27166
* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Handle
-z lam-u48 and -z lam-u57.
ld/
PR ld/27166
* testsuite/ld-x86-64/lam-u48.rd: New file.
* testsuite/ld-x86-64/lam-u57.rd: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Add PR ld/27166 tests.
|
|
|
|
|
|
Since LAM_U48 implies LAM_U57, also set LAM_U57 when setting LAM_U48.
bfd/
* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Also set
LAM_U57 when setting LAM_U48.
ld/
* ld-x86-64/property-x86-lam-u48-4.d: Updated.
* ld-x86-64/property-x86-lam-u48-5.d: Likewise.
|
|
commit f478212851 did the regen by hand, missed a change in
ld/configure and didn't update line numbers. Fix that, and an old
regen of ld/Makefile.in with the wrong automake.
bfd/
* configure: Regenerate.
binutils/
* configure: Regenerate.
gas/
* configure: Regenerate.
gprof/
* configure: Regenerate.
ld/
* Makefile.in: Regenerate.
* configure: Regenerate.
libctf/
* configure: Regenerate.
opcodes/
* configure: Regenerate.
zlib/
* configure: Regenerate.
|
|
47a889a4ca20 ("Improve GNU/Hurd support.") fixed detection of shlibpath_overrides_runpath, thus avoiding unnecessary relink. This backports it.
. * libtool.m4: Match gnu* along other GNU systems.
*/ChangeLog:
* configure: Re-generate.
|
|
For ELF targets, section symbols are required only for relocations.
With -ffunction-sections -fdata-sections, there can be many unused
section symbols. Sizes of libstdc++.a on Linux/x86-64 in GCC 11 are
With unused section symbols : 39411698 bytes
Without unused section symbols: 39227002 bytes
The unused section symbols in libstdc++.a occupy more than 180 KB.
Add BSF_SECTION_SYM_USED to indicate if a section symbol should be
included in the symbol table. The BSF_SECTION_SYM_USED should be set
if the section symbol is used for relocation or the section symbol is
always included in the symbol table.
Add keep_unused_section_symbols to bfd_target to indicate if unused
section symbols should be kept. If TARGET_KEEP_UNUSED_SECTION_SYMBOLS
is defined as FALSE, unused ection symbols will be removed.
Tested on Linux/x86. Other ELF backends need to:
1. Define TARGET_KEEP_UNUSED_SECTION_SYMBOLS to FALSE.
2. Mark used section symbols in assembler backend.
3. Remove unused section symbols from expected assembler and linker
outputs.
bfd/
PR 27109
* aix386-core.c (core_aix386_vec): Initialize
keep_unused_section_symbol to TARGET_KEEP_UNUSED_SECTION_SYMBOLS.
* aout-target.h (MY (vec)): Likewise.
* binary.c (binary_vec): Likewise.
* cisco-core.c (core_cisco_be_vec): Likewise.
(core_cisco_le_vec): Likewise.
* coff-alpha.c (alpha_ecoff_le_vec): Likewise.
* coff-i386.c (TARGET_SYM): Likewise.
(TARGET_SYM_BIG): Likewise.
* coff-ia64.c (TARGET_SYM): Likewise.
* coff-mips.c (mips_ecoff_le_vec): Likewise.
(mips_ecoff_be_vec): Likewise.
(mips_ecoff_bele_vec): Likewise.
* coff-rs6000.c (rs6000_xcoff_vec): Likewise.
(powerpc_xcoff_vec): Likewise.
* coff-sh.c (sh_coff_small_vec): Likewise.
(sh_coff_small_le_vec): Likewise.
* coff-tic30.c (tic30_coff_vec): Likewise.
* coff-tic54x.c (tic54x_coff0_vec): Likewise.
(tic54x_coff0_beh_vec): Likewise.
(tic54x_coff1_vec): Likewise.
(tic54x_coff1_beh_vec): Likewise.
(tic54x_coff2_vec): Likewise.
(tic54x_coff2_beh_vec): Likewise.
* coff-x86_64.c (TARGET_SYM): Likewise.
(TARGET_SYM_BIG): Likewise.
* coff64-rs6000.c (rs6000_xcoff64_vec): Likewise.
(rs6000_xcoff64_aix_vec): Likewise.
* coffcode.h (CREATE_BIG_COFF_TARGET_VEC): Likewise.
(CREATE_BIGHDR_COFF_TARGET_VEC): Likewise.
(CREATE_LITTLE_COFF_TARGET_VEC): Likewise.
* elfxx-target.h (TARGET_BIG_SYM): Likewise.
(TARGET_LITTLE_SYM): Likewise.
* hppabsd-core.c (core_hppabsd_vec): Likewise.
* hpux-core.c (core_hpux_vec): Likewise.
* i386msdos.c (i386_msdos_vec): Likewise.
* ihex.c (ihex_vec): Likewise.
* irix-core.c (core_irix_vec): Likewise.
* mach-o-target.c (TARGET_NAME): Likewise.
* mmo.c (mmix_mmo_vec): Likewise.
* netbsd-core.c (core_netbsd_vec): Likewise.
* osf-core.c (core_osf_vec): Likewise.
* pdp11.c (MY (vec)): Likewise.
* pef.c (pef_vec): Likewise.
(pef_xlib_vec): Likewise.
* plugin.c (plugin_vec): Likewise.
* ppcboot.c (powerpc_boot_vec): Likewise.
* ptrace-core.c (core_ptrace_vec): Likewise.
* sco5-core.c (core_sco5_vec): Likewise.
* som.c (hppa_som_vec): Likewise.
* srec.c (srec_vec): Likewise.
(symbolsrec_vec): Likewise.
* tekhex.c (tekhex_vec): Likewise.
* trad-core.c (core_trad_vec): Likewise.
* verilog.c (verilog_vec): Likewise.
* vms-alpha.c (alpha_vms_vec): Likewise.
* vms-lib.c (alpha_vms_lib_txt_vec): Likewise.
* wasm-module.c (wasm_vec): Likewise.
* xsym.c (sym_vec): Likewise.
* elf.c (ignore_section_sym): Return TRUE if BSF_SECTION_SYM_USED
isn't set.
(elf_map_symbols): Don't include ignored section symbols.
* elfcode.h (elf_slurp_symbol_table): Also set
BSF_SECTION_SYM_USED on STT_SECTION symbols.
* elflink.c (bfd_elf_final_link): Generated section symbols only
when emitting relocations or reqired.
* elfxx-x86.h (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New.
* syms.c (BSF_SECTION_SYM_USED): New.
* targets.c (TARGET_KEEP_UNUSED_SECTION_SYMBOLS): New.
(bfd_target): Add keep_unused_section_symbols.
(bfd_keep_unused_section_symbols): New.
* bfd-in2.h: Regenerated.
binutils/
PR 27109
* objcopy.c (copy_object): Handle section symbols for
non-relocatable inputs.
* testsuite/binutils-all/readelf.exp (readelf_test): Check
is_elf_unused_section_symbols.
* testsuite/binutils-all/readelf.s-64: Updated.
* testsuite/binutils-all/readelf.ss: Likewise.
* testsuite/binutils-all/readelf.ss-64: Likewise.
* testsuite/binutils-all/readelf.s-64-unused: New file.
* testsuite/binutils-all/readelf.ss-64-unused: Likewise.
* testsuite/binutils-all/readelf.ss-unused: Likewise.
* testsuite/lib/binutils-common.exp
(is_elf_unused_section_symbols): New proc.
gas/ChangeLog:
PR 27109
* read.c (s_reloc): Call symbol_mark_used_in_reloc on the
section symbol.
* subsegs.c (subseg_set_rest): Set BSF_SECTION_SYM_USED if needed.
* write.c (adjust_reloc_syms): Call symbol_mark_used_in_reloc
on the section symbol.
(set_symtab): Don't generate unused section symbols.
(maybe_generate_build_notes): Call symbol_mark_used_in_reloc
on the section symbol.
* config/obj-elf.c (elf_adjust_symtab): Call
symbol_mark_used_in_reloc on the group signature symbol.
* testsuite/gas/cfi/cfi-label.d: Remove unused section symbols
from expected output.
* testsuite/gas/elf/elf.exp (run_elf_list_test): Check
is_elf_unused_section_symbols.
* testsuite/gas/elf/section2.e: Updated.
* testsuite/gas/elf/section2.e-unused: New file.
* testsuite/gas/elf/symver.d: Remove unused section symbols.
* testsuite/gas/i386/ilp32/elf/symver.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-size-1.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-size-3.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-size-5.d: Likewise.
* testsuite/gas/i386/ilp32/x86-64-unwind.d: Likewise.
* testsuite/gas/i386/size-1.d: Likewise.
* testsuite/gas/i386/size-3.d: Likewise.
* testsuite/gas/i386/svr4.d: Likewise.
* testsuite/gas/i386/x86-64-size-1.d: Likewise.
* testsuite/gas/i386/x86-64-size-3.d: Likewise.
* testsuite/gas/i386/x86-64-size-5.d: Likewise.
* testsuite/gas/i386/x86-64-unwind.d: Likewise.
ld/
PR 27109
* testsuite/ld-elf/export-class.sd: Adjust the expected output.
* testsuite/ld-elf/loadaddr3b.d: Likewise.
* testsuite/ld-i386/ibt-plt-1.d: Likewise.
* testsuite/ld-i386/ibt-plt-2a.d: Likewise.
* testsuite/ld-i386/ibt-plt-2c.d: Likewise.
* testsuite/ld-i386/ibt-plt-3a.d: Likewise.
* testsuite/ld-i386/ibt-plt-3c.d: Likewise.
* testsuite/ld-i386/pr19636-1d.d: Likewise.
* testsuite/ld-i386/pr19636-1l.d: Likewise.
* testsuite/ld-i386/pr19636-2c.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-i386-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-local-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-2-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/ifunc-21-x86-64.d: Likewise.
* testsuite/ld-ifunc/ifunc-22-x86-64.d: Likewise.
* testsuite/ld-ifunc/pr17154-i386-now.d: Likewise.
* testsuite/ld-ifunc/pr17154-i386.d: Likewise.
* testsuite/ld-ifunc/pr17154-x86-64-now.d: Likewise.
* testsuite/ld-ifunc/pr17154-x86-64.d: Likewise.
* testsuite/ld-x86-64/bnd-branch-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2-now.d: Likewise.
* testsuite/ld-x86-64/bnd-ifunc-2.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1-now.d: Likewise.
* testsuite/ld-x86-64/bnd-plt-1.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-1.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3c.d: Likewise.
* testsuite/ld-x86-64/pr19609-4e.d: Likewise.
* testsuite/ld-x86-64/pr19609-6a.d: Likewise.
* testsuite/ld-x86-64/pr19609-6b.d: Likewise.
* testsuite/ld-x86-64/pr19609-7b.d: Likewise.
* testsuite/ld-x86-64/pr19609-7d.d: Likewise.
* testsuite/ld-x86-64/pr19636-2l.d: Likewise.
* testsuite/ld-x86-64/pr20253-1d.d: Likewise.
* testsuite/ld-x86-64/pr20253-1h.d: Likewise.
* testsuite/ld-x86-64/pr21038b-now.d: Likewise.
* testsuite/ld-x86-64/pr21038b.d: Likewise.
* testsuite/ld-x86-64/pr21038c-now.d: Likewise.
* testsuite/ld-x86-64/pr21038c.d: Likewise.
* testsuite/ld-x86-64/pr23854.d: Likewise.
* testsuite/ld-x86-64/pr25416-3.d: Likewise.
* testsuite/ld-x86-64/pr25416-4.d: Likewise.
* testsuite/ld-i386/plt-pic.pd: Likewise.
* testsuite/ld-i386/plt-pic2.dd: Likewise.
* testsuite/ld-i386/plt.pd: Likewise.
* testsuite/ld-i386/plt2.dd: Likewise.
* testsuite/ld-i386/tlsbin.rd: Likewise.
* testsuite/ld-i386/tlsbin2.rd: Likewise.
* testsuite/ld-i386/tlsbindesc.rd: Likewise.
* testsuite/ld-i386/tlsdesc.rd: Likewise.
* testsuite/ld-i386/tlsgdesc.rd: Likewise.
* testsuite/ld-i386/tlsnopic.rd: Likewise.
* testsuite/ld-i386/tlspic.rd: Likewise.
* testsuite/ld-i386/tlspic2.rd: Likewise.
* testsuite/ld-x86-64/mpx3.dd: Likewise.
* testsuite/ld-x86-64/mpx3n.dd: Likewise.
* testsuite/ld-x86-64/mpx4.dd: Likewise.
* testsuite/ld-x86-64/mpx4n.dd: Likewise.
* testsuite/ld-x86-64/pe-x86-64-1.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-2.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-3.od: Likewise.
* testsuite/ld-x86-64/pe-x86-64-4.od: Likewise.
* testsuite/ld-x86-64/plt.pd: Likewise.
* testsuite/ld-x86-64/plt2.dd: Likewise.
* testsuite/ld-x86-64/tlsbin.rd: Likewise.
* testsuite/ld-x86-64/tlsbin2.rd: Likewise.
* testsuite/ld-x86-64/tlsbindesc.rd: Likewise.
* testsuite/ld-x86-64/tlsdesc.rd: Likewise.
* testsuite/ld-x86-64/tlsgdesc.rd: Likewise.
* testsuite/ld-x86-64/tlspic.rd: Likewise.
* testsuite/ld-x86-64/tlspic2.rd: Likewise.
* testsuite/ld-elf/sec64k.exp: Check
is_elf_unused_section_symbols.
|
|
* testsuite/ld-scripts/fill.d: Skip sh-*-pe rather than xfail.
* testsuite/ld-scripts/fill16.d: Don't xfail sh-*-pe.
* testsuite/ld-scripts/segment-start.d: Likewise.
|
|
* testsuite/ld-elf/comm-data5.d: xfail targets that complain
about dynamic relocations in read-only sections.
* testsuite/ld-elf/ehdr_start-shared.d: Likewise.
* testsuite/ld-elf/ehdr_start.d: Likewise.
* testsuite/ld-scripts/pr22267.d: Likewise.
* testsuite/ld-elf/shared.exp: Likewise for DT_TEXTREL tests and
pr20995 text.
* testsuite/ld-elf/sec64k.exp: Don't run 64ksec on lm32-linux.
|
|
For now we have supported the riscv big endian targets, so
xfail riscv64*-*-* for ld-scripts/empty-address-2 tests, to
cover both little endian and big endian targets.
ld/
* testsuite/ld-scripts/empty-address-2a.d: xfail riscv64*-*-*.
* testsuite/ld-scripts/empty-address-2b.d: Likewise.
|
|
* po/BLD-POTFILES.in: Regenerate.
|
|
* testsuite/ld-elf/shared.exp: xfail pr22471 for targets that
complain about relocs in read-only sections. Tidy ASFLAGS append.
|
|
A bunch of ld tests fail on these targets due to the test specifying
-melf32_sparc or -melf64_sparc, which according to ld/configure.tgt
are valid. However, config.bfd lacks the corresponding bfd target
resulting in an error. Fix that by adding target_selvecs.
bfd/
* config.bfd (sparc-*-solaris2*): Add sparc_elf32_vec.
(sparc64-*-solaris2*): Add sparc_elf64_vec and
sparc_elf32_vec.
ld/
* testsuite/ld-sparc/sparc.exp (sparc64tests): Set text-segment
base for some tests.
* testsuite/ld-sparc/gotop32.dd: Match solaris output.
* testsuite/ld-sparc/gotop32.sd: Likewise.
* testsuite/ld-sparc/gotop32.td: Likewise.
* testsuite/ld-sparc/gotop64.dd: Likewise.
* testsuite/ld-sparc/gotop64.sd: Likewise.
* testsuite/ld-sparc/gotop64.td: Likewise.
* testsuite/ld-sparc/tlsg32.sd: Likewise.
* testsuite/ld-sparc/tlsg64.sd: Likewise.
* testsuite/ld-sparc/tlspie32.dd: Likewise.
* testsuite/ld-sparc/tlspie64.dd: Likewise.
* testsuite/ld-sparc/tlssunbin32.dd: Likewise.
* testsuite/ld-sparc/tlssunbin32.sd: Likewise.
* testsuite/ld-sparc/tlssunbin32.td: Likewise.
* testsuite/ld-sparc/tlssunbin64.dd: Likewise.
* testsuite/ld-sparc/tlssunbin64.sd: Likewise.
* testsuite/ld-sparc/tlssunbin64.td: Likewise.
* testsuite/ld-sparc/tlssunnopic32.dd: Likewise.
* testsuite/ld-sparc/tlssunnopic32.sd: Likewise.
* testsuite/ld-sparc/tlssunnopic64.dd: Likewise.
* testsuite/ld-sparc/tlssunnopic64.sd: Likewise.
* testsuite/ld-sparc/tlssunpic32.dd: Likewise.
* testsuite/ld-sparc/tlssunpic32.sd: Likewise.
* testsuite/ld-sparc/tlssunpic32.td: Likewise.
* testsuite/ld-sparc/tlssunpic64.dd: Likewise.
* testsuite/ld-sparc/tlssunpic64.sd: Likewise.
* testsuite/ld-sparc/tlssunpic64.td: Likewise.
* testsuite/ld-sparc/wdispcall.dd: Likewise.
|