v1.0.1
版本发布时间: 2021-12-31 13:20:43
rui314/mold最新发布版本:v2.34.0(2024-09-25 13:04:28)
mold 1.0 is a maintenance release of the high-speed linker. It contains a few new features and various bug fixes.
New features
-
make install
now creates/usr/local/libexec/mold/ld
as a symlink to themold
executable. We do this for GCC. By passing-B/usr/local/libexec/mold
, you can tell GCC to useld
inside that directory instead of/usr/bin/ld
. (e8dcecfff0391af8d04d00845c36070a628e8c02) - xxHash library is now included in the mold's source tree as a subtree for ease of building. If you want to link against a libxxhash in a system library directory, pass
SYSTEM_XXHASH=1
tomake
. (665bffa52f3fc979c608c72f3fdf2f8280eeb13b) - The
extern "C++"
directive is now supported in the dynamic list. (7aa5c393e4bc1d35509f9ee7cc2980314359f89c) -
--color-diagnostics
is supported. mold used to ignore that flag. (6e290aab3e2bf445df46d117832579bf6ab2aa1c) - Not only
*
but also?
are now treated as special characters in the version script wildcard pattern. (31b0248b05e433c0589fe2736e61852515427d9a) - The
--threads=N
option has been added as an alias for--thread-count=N
. (f9ff04866e9926b343d71d45facdb693ef37928d) - The following option has been added:
--defsym
(f6e800655b3ed6a5118017d4cdfddbba3b4fbf40),-z nodefaultlib
(8c86c2849697dd2a5747b075fa818ebead6b09e1),-z separate-code
,-z noseparate-code
and-z separate-lodable-segments
(5601cf42366a20e04b080923fe535ab502929732),-z max-page-size
(f3766cda81f395adc84f79f2ab057a747172a1ef)
Bug fixes and compatibility improvements
- mold now issue a warning instead of an error for an unknown
-z
option. (8bc57363c8ea90c8bdc99274a03da1e347030255) - mold previously created a PT_NOTE segment for non-SHF_ALLOC note segments. This is a wrong behavior because we should create segments only for memory-allocated sections. This problem has been fixed. (76407a66468802f42889fd161f1aa5a6c301dc9f)
- Previously, a version script can affect symbol visibility of undefined symbols when they are promoted to dynamic symbols. This is a semantically incorrect behavior and caused a libQt build failure (https://github.com/rui314/mold/issues/151). The issue has been fixed. (36633895e58c9cbb089ad80c64d9208a06e2baba)
- Previously, mold silently turned unresolved undefined symbols into absolute symbols with value 0 if
-shared
,-z defs
and-warn-undefined-symbols
are specified. Even though this behavior makes sense, it's not compatible with GNU ld which promotes such symbols into dynamic symbols. This incompatibility causes a link failure for Firefox. Since 1.0.1, mold behaves the same as GNU ld. (04ccd4dbdd77f6bc10508b19ab12e46cc9c32731) - Previously, mold applied wrong values for relocations against Initial-Exec thread-local variables. That caused a link failure for Mesa 3D graphics library (https://github.com/rui314/mold/issues/197). The issue has been resolved. (d1161137d9de64892e193cecda16fdf2f585351f)
- GCC 7 has a bug that it emits incorrect relocations against thread-local variables under a certain condition. That bug was unnoticed because existing linkers silently produces an output that works fine in most cases but is technically corrupted. mold used to check for that error condition and report an error. Now, mold does not report it as an error for the sake of bug-compatibility with GCC 7. I don't think relaxing the error check will cause any new issue to existing GCC 7 users, because if it does, they would have been experiencing the issue with existing linkers already. (d9606d65b5da7e7af4c1858a121264e80e58ef49)
- If an output file has more than one sections for thread-local BSS, they were laid out in such that they are overlapping with each other. This bug caused a runtime error for programs compiled with DMD, a compiler for the D language (https://github.com/rui314/mold/issues/126). This layout issue has been resolved. (https://github.com/rui314/mold/commit/b151de6684a9b48381cc6340fa10b6e1cfc1a8c5)
- Previously, mold failed to look up correct files under
--sysroot
in some conditions. That caused a link failure for ClickHouse (https://github.com/rui314/mold/issues/150). This bug has been fixed. (135f17c5aa930fdd2441080a086f0a6379774c57)