1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 08:37:35 +00:00

Toolchain+Ports: Update binutils to 2.41

Aside from a straightforward rebase, this contains an out-of-tree patch
from MaskRay which adds the `-Bsymbolic-non-weak-functions` flag to ld.
This commit is contained in:
Daniel Bertalan 2023-09-04 07:48:49 +02:00
parent ae21002cb5
commit 4defa401d3
7 changed files with 346 additions and 49 deletions

View file

@ -14,3 +14,30 @@ division in constant expressions in assembly files (cf. as --divide).
On AArch64, we set `COMMONPAGESIZE` to enable RELRO support.
## `0002-ld-Add-Bsymbolic-non-weak-functions.patch`
ld: Add -Bsymbolic-non-weak-functions
This option is a subset of -Bsymbolic-functions: only STB_GLOBAL are
considered. Vague linkage functions are STB_WEAK. A vague linkage
function may have different addresses in a -Bsymbolic-functions linked
shared object and outside the shared object.
-Bsymbolic-non-weak-functions can keep pointer equality while providing
most benefits: (a) fewer JUMP_SLOT (symbol lookups) (b) avoid PLT
entries for default visibility defined functions.
PR 27871
include/
* bfdlink.h (struct bfd_link_info): Add dynamic_weak_functions.
ld/
* ldlex.h (enum option_values): Add OPTION_SYMBOLIC_NON_WEAK_FUNCTIONS.
* lexsup.c (struct ld_options): Add -Bsymbolic-non-weak-functions.
(enum symbolic_enum): Add symbolic_non_weak_functions.
(parse_args): Handle -Bsymbolic-non-weak-functions.
* ld.texi: Document -Bsymbolic-non-weak-functions.
* NEWS: Mention -Bsymbolic-non-weak-functions.
* testsuite/ld-elf/shared.exp: Add tests.
* testsuite/ld-elf/symbolic-non-weak-func.s: New file.
* testsuite/ld-elf/symbolic-non-weak-func-a.rd: Likewise.
* testsuite/ld-elf/symbolic-non-weak-func-b.rd: Likewise.