mold 1.2.0
mold 1.2.0 is a new release of the high-speed linker. The highlight of this release is the 32-bit ARM support. We also added other features, and as always, we fixed many bugs and compatibility issues in this release.
New features
- The ARM32 target is now supported.
--gdb-indexis implemented. If this option is given, mold creates an.gdb_indexsection in an output file to speed up GNU debugger. Users have to compile their object files with-ggnu-pubnamesto use this flag. mold used to ignore--gdb-index. (a7475dd)- mold now supports the following flags:
--start-address,-Tbss,-Tdata,-Ttext,--oformat=binary,--disable-new-dtags
Deprecated features
- An experimental, mold-specific
--preloadflag has been marked as deprecated. It's still usable, but a warning message will be displayed if that flag is given.
Bug fixes and compatibility improvements
-dyand-dnare now accepted as aliases for-Bdynamicand-Bstatic, respectively. (82e8072)-static-pienow works with older versions of glibc thanks to a few bug fixes. (3d68824, 0884f27)- Issues found by UndefinedBehaviorSanizer, AddressSanitizer and ThreadSanitizer are fixed. (bf26753, f4753b3, e1e4e9f)
- mold used to place sections with very large section alignment requirements to wrong places in an output file. That caused a mysterious crash of a produced binary (#405). That bug was most noticeable when Nvidia-provided object files are given because they tend to contain such sections. This bug has been fixed. (100922b)
.ctorsand.dtorssections are now recognized by mold, and their contents are sorted with a special rule. This shouldn't affect most build environments because these sections have been superseded by.init_arrayand.fini_arraysections a long time ago. But it looks like some old i386 compilers are still using.ctorsand.dtors. (392781a)- For a non-position-independent executable, we have to make address-taken PLT entries as "canonical". Marking all PLT entries canonical should be harmless in theory, so we did so. However, some programs, notably Qt library, assume that non-address-taken PLTs can never be canonical (#352). For the sake of compatibility with such programs, we now make PLTs canonical only when their addresses are taken. (e0bc74a)
- mold now defines
_TLS_MODULE_BASE_symbol. A reference to this symbol can occur if-mtls-dialect=gnu2is given to a compiler. The flag tells the compiler to use TLSDESC mechanism instead of the regular TLS access mechanism to access thread-local variables. (5feab82) - libbacktrace sometimes fail to read compressed debug sections in mold-generated files due to a bug. We not only fix that libbacktrace's bug (ianlancetaylor/libbacktrace#87) but also implemented a workaround to mold (ba63479) so that mold works with older versions of libbacktrace.
- [ARM64] mold now recognizes
R_AARCH64_LD_PREL_LO19relocation. (146ddd7) - [RISCV64] The correct semantics of
R_RISCV_ALIGNis implemented. (0daf623)