Path to this page:
Subject: CVS commit: pkgsrc/devel/mold
From: Frederic Cambus
Date: 2023-11-05 17:59:36
Message id: 20231105165936.39678FA2C@cvs.NetBSD.org
Log Message:
mold: update to 2.3.2.
mold 2.3.0 ChangeLog:
New features:
- [x86-64] mold 2.3.0 has introduced an experimental flag, -z rewrite-endbr,
which rewrites superfluous endbr64 instructions as nop.
endbr64 is a relatively recent x86 instruction used to mark locations
where an indirect jump instruction can transfer control. With control-flow
integrity enabled (meaning endbr64 is effective), an indirect jump can
only target an endbr64 or it will trigger a runtime exception. This
mechanism significantly hinders certain control hijacking attacks, such
as ROP or JOP, since attackers cannot jump to just any location.
When given the -fcf-protection flag, GCC conservatively places an endbr64
at the beginning of every global function. This is because the function's
address might be taken as a pointer by other translation units. However,
in most cases, function addresses are not actually taken. This conservative
approach results in an overabundance of unnecessary endbr64 instructions,
leading to not only code bloating but also a potential decrease in security
as there are more locations for an attacker to exploit.
The new linker option, -z rewrite-endbr, aims to alleviate this issue.
The linker can carry out a whole-program analysis on the input files to
identify functions whose addresses are never taken. If -z rewrite-endbr
is specified, mold will conduct this analysis and replace the initial
endbr64 with a nop for functions whose addresses aren't taken.
mold also emits an endbr64 in a PLT entry only when the address of the
PLT entry is taken.
Bug fixes and compatibility improvements:
- mold now produces a more compact .gdb_index section when using the
--gdb-index flag. Additionally, mold now generates a correct .gdb_index
section for object files created by Clang.
- mold is now capable of handling input sections larger than 4 GiB.
- [PPC] mold can now generate executables for POWER10 processors. Previously,
executables produced by mold would crash immediately on startup on POWER10.
- [ARM64] When a function with a non-standard calling convention is exported,
it's mandatory for the linker to turn on the STO_AARCH64_VARIANT_PCS flag
to notify the dynamic linker. mold now appropriately sets this flag.
- [RISC-V] mold now supports new GP-relative relocations.
mold 2.3.1 contains the following bug fixes:
- [ARM32, ARM64, PowerPC, LoongArch] mold 2.3.0 would crash when handling
large output files. This was due to a bug in the code that creates range
extension thunks. This issue has now been resolved.
- [LoongArch] mold is now capable of handling relocations generated for
the -mcmodel=extreme flag.
mold 2.3.2 contains the following bug fixes:
- mold no longer emits dynamic relocations against the text segment for
GNU ifunc symbols. Previously, mold emitted such relocations for
position-dependent executables. (4cdfc7e)
- mold no longer reports the "REL-type relocation table is not supported
for this target" error and instead ignore incompatible relocation tables.
LLVM generates such non-conforming relocation tables for the
.llvm.call-graph-profile section. This change was made for compatibility.
- mold now pads unused gaps in the text segment with interrupt or NOP
instructions, instead of leaving them filled with zeros. This alteration
does not change the program's semantics but prevents disassemblers from
interpreting the spaces between functions as valid instructions.
- mold now creates the .mold-lock file for MOLD_JOBS not in the home
directory but in $XDG_RUNTIME_DIR, which is usually /var/user/<uid>.
- [ARM32] There was an issue preventing mold from being built on an ARMv8
64-bit ARM processor with an ARM32 userland, such as the 32-bit Raspberry
Pi OS running on a Raspberry Pi 4. This build issue has been resolved.
- [LoongArch] mold can now handle R_LARCH_PCALA_LO12 relocation for the
jirl instruction.
Files: