Age | Commit message (Collapse) | Author | Files | Lines |
|
Ensure all local symbols precede external symbols in the dynamic symbol
table.
No local symbols are expected to make it to the dynamic symbol table
except for section symbols already taken care of, so this is really a
safeguard only against a potential BFD bug otherwise not so harmful,
which may become a grave one due to a symbol table sorting requirement
violation (see PR ld/20828 for an example). This means however that no
test suite coverage is possible for this change as code introduced here
is not normally expected to trigger.
Logically split then the part of the dynamic symbol table which is not
global offset table mapped, into a local area at the beginning and an
external area following. By the time `mips_elf_sort_hash_table' is
called we have the number of local dynamic symbol table entries (section
and non-section) already counted in `local_dynsymcount', so use it to
offset the external area from the beginning.
bfd/
* elfxx-mips.c (mips_elf_hash_sort_data): Add
`max_local_dynindx'.
(mips_elf_sort_hash_table): Handle it.
(mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
symbols bump up `max_local_dynindx' rather than
`max_non_got_dynindx'.
(cherry picked from commit e17b0c351f0b22fb42edf34e5a6e486d72e9ee05)
|
|
Use the `bfd_size_type' data type for dynamic symbol table indices in
the MIPS backend, in line with generic code and removing the need to use
a cast.
bfd/
* elfxx-mips.c (mips_elf_hash_sort_data): Convert the
`min_got_dynindx', `max_unref_got_dynindx' and
`max_non_got_dynindx' members to the `bfd_size_type' data type.
(mips_elf_sort_hash_table): Adjust accordingly.
(cherry picked from commit 55f8b9d243dbd879ffa585f7e0c7d8b6b819302d)
|
|
Make all hash table references throughout `mips_elf_sort_hash_table' use
`htab', simplifying code and improving readability.
bfd/
* elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
to access the hash table.
(cherry picked from commit 0f8c4b60ef3953a2373992e468106ae833049fff)
|
|
Move the assertion on non-NULL `htab' in `mips_elf_sort_hash_table' to
the beginning, before the pointer is dereferenced (`mips_elf_hash_table
(info)' and `elf_hash_table (info)' both point to the same memory
location, differently typed).
bfd/
* elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
non-NULL `htab' to the beginning.
(cherry picked from commit 17a80fa80adbe79df39ba1fc70e611dff92df197)
|
|
|
|
|
|
* cgen-opc.c (cgen_lookup_insn): Delete buf and base_insn temps.
Use insn_bytes_value and insn_int_value directly instead. Don't
free allocated memory until function exit.
|
|
opcodes/
* ppc-opc.c (powerpc_opcodes) <scv, rfscv>: New mnemonics.
gas/
* testsuite/gas/ppc/power9.d <scv, rfscv>: New tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* powerpc.cc (Powerpc_relobj::make_toc_relative): Don't crash
when no .toc section exists.
|
|
PR ld/21000
* emulparams/hppalinux.sh (DATA_ADDR, SHLIB_DATA_ADDR): Don't define.
(DATA_SEGMENT_ALIGN, DATA_SEGMENT_END, DATA_SEGMENT_RELRO_END): Define.
* scripttempl/elf.sc: Don't define the above if DATA_SEGMENT_ALIGN
is already defined.
|
|
Fixes: tmpdir/pr14525: symbol lookup error: tmpdir/pr14525: undefined
symbol: __executable_start
FAIL: PIE PR ld/14525
* elf32-hppa.c (ensure_undef_weak_dynamic): New function.
(allocate_plt_static, allocate_dynrelocs): Use it.
|
|
This flag should be set for any section header using sh_info to
point to another section.
Fixes a readelf warning about an unexpected value in info field,
resulting in FAIL: Build warn libbar.so
* elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
.PARISC.unwind section.
|
|
* elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
local variable dynobj.
PR ld/20995
* elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
(elf_cris_adjust_dynamic_symbol): Place variables copied into the
executable from read-only sections into sdynrelro.
(elf_cris_finish_dynamic_symbol): Select sreldynrelro for
dynamic relocs in sdynrelro.
(elf_backend_want_dynrelro): Define.
|
|
* emulparams/criself.sh (USER_LABEL_PREFIX): Define.
(OTHER_END_SYMBOLS, ENTRY): Delete now-redundant defines.
|
|
|
|
|
|
Fix commit 171191bac50e ("Add support for STT_IFUNC"),
<https://sourceware.org/ml/binutils/2008-12/msg00052.html>, commit
e04d7088afe0 ("PR ld/14088: Always display addend as signed hex
number"), <https://sourceware.org/ml/binutils/2012-05/msg00123.html> and
commit 343dbc36ffae ("Print addend as signed in objdump"),
<https://sourceware.org/ml/binutils/2012-05/msg00163.html> regressions:
FAIL: VxWorks executable test 1 (dynamic)
FAIL: ld-mips-elf/vxworks-forced-local-1
seen with `mips-vxworks' and `mipsel-vxworks' targets and adjust dump
patterns according to changes made to the presentation of relocation
addends in `readelf -r' and `objdump -r' output.
ld/
* testsuite/ld-mips-elf/vxworks-forced-local-1.d: Correct the
presentation of relocation addends.
* testsuite/ld-mips-elf/vxworks1-lib.rd: Likewise.
* testsuite/ld-mips-elf/vxworks1.dd: Likewise.
* testsuite/ld-mips-elf/vxworks1.rd: Likewise.
(cherry picked from commit c0c237fcdd133e84e67657cc6b7e4678f106bdcb)
|
|
Correct a commit ec9ab52c3217 ("gas: consistently emit diagnostics for
non-zero data emission to .bss/.struct"),
<https://sourceware.org/ml/binutils/2015-12/msg00073.html> regression:
.../ld/testsuite/ld-mips-elf/tls-multi-got-1-1.s: Assembler messages:
.../ld/testsuite/ld-mips-elf/tls-multi-got-1-1.s:39: Error: attempt to store non-zero value in section `.tbss'
ERROR: -EB -march=mips1 -32 -KPIC .../ld/testsuite/ld-mips-elf/tls-multi-got-1-1.s: assembly failed
UNRESOLVED: Shared library with multiple GOTs and TLS
in MIPS target testing and move `tlsvar_ld' to `.tdata' section, in line
with the remaining local dynamic definitions introduced with the set of
tests added with commit f4e584bd00f1 ("TLS support for MIPS"),
<https://sourceware.org/ml/binutils/2005-02/msg00607.html>.
ld/
* testsuite/ld-mips-elf/tls-multi-got-1-1.s: Place `tlsvar_ld'
in `.tdata' section.
* testsuite/ld-mips-elf/tls-multi-got-1.got: Adjust accordingly.
* testsuite/ld-mips-elf/tls-multi-got-1.r: Likewise.
(cherry picked from commit 5139cfdb5515407900d0c3934c13712a5819456c)
|
|
The use of te-linux.h is unnecessary since the TE_LINUX define is unused
and LOCAL_LABELS_FB is defined to 1 in tc-riscv.h as well.
gas/
* configure.tgt (riscv*-*-*): Remove em=linux.
|
|
|
|
|
|
Complement commit 9d862524f6ae ("MIPS: Verify the ISA mode and alignment
of branch and jump targets") and add GAS and LD options to control the
checks for invalid branches between ISA modes introduced there, to help
with some handwritten code lacking `.insn' annotation for labels used as
branch targets and code produced by older versions of GCC which suffers
from the issue with branches to code that has been optimized away,
addressed with GCC commit 242424 ("MIPS/GCC: Mark trailing labels with
`.insn'"), <https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01061.html>.
bfd/
* elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
(_bfd_mips_elf_linker_flags): ... this. Add another parameter.
* elfxx-mips.c (mips_elf_link_hash_table): Add
`ignore_branch_isa' member.
(mips_elf_perform_relocation): Do not treat an ISA mode mismatch
in branch relocation calculation as an error if
`ignore_branch_isa' has been set.
(_bfd_mips_elf_insn32): Rename to...
(_bfd_mips_elf_linker_flags): ... this. Rename the `on'
parameter to `insn32' and add an `ignore_branch_isa' parameter.
Handle the new parameter.
gas/
* config/tc-mips.c (mips_ignore_branch_isa): New variable.
(options): Add OPTION_IGNORE_BRANCH_ISA and
OPTION_NO_IGNORE_BRANCH_ISA enum values.
(md_longopts): Add "mignore-branch-isa" and
"mno-ignore-branch-isa" options.
(md_parse_option): Handle OPTION_IGNORE_BRANCH_ISA and
OPTION_NO_IGNORE_BRANCH_ISA.
(fix_bad_cross_mode_branch_p): Return FALSE if
`mips_ignore_branch_isa' has been set.
(md_show_usage): Add `-mignore-branch-isa' and
`-mno-ignore-branch-isa'.
* doc/as.texinfo (Target MIPS options): Add
`-mignore-branch-isa' and `-mno-ignore-branch-isa' options.
(-mignore-branch-isa, -mno-ignore-branch-isa): New options.
* doc/c-mips.texi (MIPS Options): Add `-mignore-branch-isa' and
`-mno-ignore-branch-isa' options.
* testsuite/gas/mips/branch-local-ignore-2.d: New test.
* testsuite/gas/mips/branch-local-ignore-3.d: New test.
* testsuite/gas/mips/branch-local-ignore-n32-2.d: New test.
* testsuite/gas/mips/branch-local-ignore-n32-3.d: New test.
* testsuite/gas/mips/branch-local-ignore-n64-2.d: New test.
* testsuite/gas/mips/branch-local-ignore-n64-3.d: New test.
* testsuite/gas/mips/mips.exp: Run the new tests.
ld/
* emultempl/mipself.em (ignore_branch_isa): New variable.
(mips_create_output_section_statements): Rename
`_bfd_mips_elf_insn32' called to `_bfd_mips_elf_linker_flags',
add `ignore_branch_isa' argument.
(PARSE_AND_LIST_PROLOGUE): Add OPTION_IGNORE_BRANCH_ISA and
OPTION_NO_IGNORE_BRANCH_ISA enum values.
(PARSE_AND_LIST_LONGOPTS): Add "ignore-branch-isa" and
"no-ignore-branch-isa" options.
(PARSE_AND_LIST_OPTIONS): Add `--ignore-branch-isa' and
`--no-ignore-branch-isa'.
(PARSE_AND_LIST_ARGS_CASES): Handle OPTION_IGNORE_BRANCH_ISA and
OPTION_NO_IGNORE_BRANCH_ISA.
* ld.texinfo (Options specific to MIPS targets): Add
`--ignore-branch-isa' and `--no-ignore-branch-isa' options.
(ld and the MIPS family): Likewise.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-n32.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-n64.d: New test.
* testsuite/ld-mips-elf/unaligned-branch-ignore-2.d: New test.
* testsuite/ld-mips-elf/unaligned-branch-ignore-r6-1: New test.
* testsuite/ld-mips-elf/unaligned-branch-ignore-mips16: New
test.
* testsuite/ld-mips-elf/unaligned-branch-ignore-micromips: New
test.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
(cherry picked from commit 8b10b0b3e100c25322a083248c7a18bf5a1f3527)
|
|
gas/
* testsuite/gas/mips/branch-local-2.d: New test.
* testsuite/gas/mips/branch-local-3.d: New test.
* testsuite/gas/mips/branch-local-n32-2.d: New test.
* testsuite/gas/mips/branch-local-n32-3.d: New test.
* testsuite/gas/mips/branch-local-n64-2.d: New test.
* testsuite/gas/mips/branch-local-n64-3.d: New test.
* testsuite/gas/mips/mips.exp: Fold corresponding list tests
into the new tests.
(cherry picked from commit 7795a8f8bdde2fa5c0e0639b92280314b32ec78d)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Correct a bug in Solaris 2 linker emulation code triggered by a test
introduced with commit 81ff47b3a546 ("PR ld/20828: Fix linker script
symbols wrongly forced local with section GC") and only create implicit
version nodes if versioning is actually introduced with a version script
(or VERSION command) rather than only global vs local symbol visibility
selected, fixing an:
ld: anonymous version tag cannot be combined with other version tags
linker error produced whenever a version script (or VERSION command) is
used that does not assign symbol versions, such as:
{ global: foo; bar; local: *; };
and consequently removing a:
FAIL: PR ld/20828 dynamic symbols with section GC (version script)
test suite failure with the `x86_64-solaris2' target.
ld/
* emultempl/solaris2.em (elf_solaris2_before_allocation): Do not
add implicit version nodes if an anonymous version tag is being
used.
(cherry picked from commit 1a792e1c00e07a1e644145a9f71446cf2e75e9ab)
|
|
gold/
* mips.cc (Mips_output_data_plt::rel_plt): Remove const from return
type.
(Target_mips::make_plt_entry): Make the sh_info field of .rel.plt
point to .plt.
|
|
gold/
PR gold/21054
* mips.cc (Mips_got_info::record_global_got_symbol): Don't add symbol
to the dynamic symbol table if it is forced to local visibility.
(Target_mips::do_finalize_sections): Don't add __RLD_MAP symbol to the
dynamic symbol table if it is forced to local visibility.
|
|
|
|
Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and add `.plt' to the list of
output sections created, fixing:
FAIL: PR ld/20828 dynamic symbols with section GC (auxiliary shared library)
FAIL: PR ld/20828 dynamic symbols with section GC (plain)
FAIL: PR ld/20828 dynamic symbols with section GC (version script)
failures with `riscv32-elf', `riscv32-linux', `riscv64-elf' and
`riscv64-linux' targets caused by LD crashing in the absence of such a
section.
ld/
PR ld/20828
* testsuite/ld-elf/pr20828.ld: Add `.plt'.
(cherry picked from commit 1e5f45bb15d287ed763b7b638254424149040f7a)
|
|
Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and remove the leading underscore
from `_fdata' and `_edata' symbols used in tests, fixing a:
FAIL: PR ld/20828 dynamic symbols with section GC (version script)
failure with targets such as: `bfin-elf', `bfin-uclinux', `metag-elf',
`metag-linux' `mn10300-elf', `sh-elf', `sh64-elf', and possibly other
ones, that have `_' set (with `elf_symbol_leading_char') as the leading
character for symbols. As from commit 93252b1cf41a ("bfd/ld: handle ABI
prefixes in version scripts") these targets strip the leading underscore
before applying version script rules, because the (default) syntax for
symbol names is that of the C language rather than their low-level
symbol table encoding.
ld/
PR ld/20828
* testsuite/ld-elf/pr20828.ld: Rename `_fdata' and `_edata' to
`fdata' and `edata' respectively.
* testsuite/ld-elf/pr20828.ver: Adjust accordingly.
* testsuite/ld-elf/pr20828-a.sd: Likewise.
* testsuite/ld-elf/pr20828-b.sd: Likewise.
* testsuite/ld-elf/pr20828-c.sd: Likewise.
(cherry picked from commit fda46c417ff8324960ca305141df5fc6c2f580af)
|
|
Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and make tests check for the
presence of global `_fdata' and `_edata' symbols separately, removing
any dependency on symbol table ordering for tests to succeed and
removing:
FAIL: PR ld/20828 dynamic symbols with section GC (auxiliary shared library)
FAIL: PR ld/20828 dynamic symbols with section GC (plain)
failures with the `x86_64-solaris2' target, which has additional
intervening entries:
Symbol table '.dynsym' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 _fdata
2: 0000000000000000 0 OBJECT GLOBAL DEFAULT 1 _DYNAMIC
3: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS _PROCEDURE_LINKAGE_TABLE_
4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 _edata
5: 00000000000001b8 0 OBJECT GLOBAL DEFAULT 4 _GLOBAL_OFFSET_TABLE_
Rename dump pattern files accordingly for consistency.
ld/
PR ld/20828
* testsuite/ld-elf/pr20828-1.sd: Remove test.
* testsuite/ld-elf/pr20828-a.sd: New test.
* testsuite/ld-elf/pr20828-2a.sd: Rename test to...
* testsuite/ld-elf/pr20828-b.sd: ... this.
* testsuite/ld-elf/pr20828-2b.sd: Rename test to...
* testsuite/ld-elf/pr20828-c.sd: ... this.
* testsuite/ld-elf/shared.exp: Adjust accordingly.
(cherry picked from commit adcbdc63e5ccf663dacc8493cec63a95b653285e)
|
|
|
|
|
|
|
|
|
|
|
|
Complement commit 9acc85a62eb7 ("Use dynrelro for symbols in relro
sections too").
ld/
PR ld/20995
* testsuite/ld-elf/elf.exp: Set GAS flags correctly for the
`mips*-*-*' target and `pr20995' and `pr20995-2' tests.
(cherry picked from commit 6984613a53528c818482c3a531e17a86bac6e7dc)
|