v1.1
版本发布时间: 2022-02-21 09:19:10
rui314/mold最新发布版本:v2.34.0(2024-09-25 13:04:28)
mold 1.1 is a new release of the high-performance linker. It contains a few new major features and various bug fixes.
Starting from this release, we distribute not only source but pre-compiled binaries for Linux. You can download a tar file containing mold
executable at the bottom of the page. You can copy the contents of the tar file to /usr/local
or just use without installation by directly specifying its full path.
New features
- Native LTO (link-time optimization) support has been added. mold used to invoke
ld.bfd
orld.lld
if it encountered a GCC IR (intermediate representation) file or an LLVM IR file to delegate the task to the LTO-capable linkers, respectively. Now, mold handles IR files directly. This feature is implemented using the linker plugin API which is also used by GNU ld and GNU gold. Note that the LTO support has been added for completeness and not for speed. mold is only marginally faster than the other linkers for LTO builds because not linking but code optimization dominates. (46995bcfc3e3113133620bf16445c5f13cd76a18) - RISC-V (RV64) is now supported as both host and target platforms. mold can link real-world large programs such as mold itself or LLVM Clang for RISC-V. (e76f7c0d474e667cc0eccac5281709664539b714)
- The
-emit-relocs
option is supported. If the option is given, mold copies relocation sections from input files to an output file. This feature is used by some post-link binary optimization or analysis tools such as Facebook's Bolt. (26fe71d64c3af2812b6349a0098d857ce2419156) - mold gained the
--shuffle-sections
option. If the option is given, the linker randomly shuffle the order of input sections before fixing their addresses in the virtual address space. This feature is useful in some situations. First, it can be used as a strong form of ASLR (address space layout randomization). Second, you can enable it when you are benchmarking some other program to get more reliable benchmark numbers, because even the same machine code can vary in performance if they are laid out differently in the virtual address space. You want to make sure that you got good/bad benchmark numbers not by coincidence by shuffling input sections. (7e918971545df3a4c90d1eaef116fc58da97da3c) - The
--print-dependencies
and--print-dependencies=full
options were added. They print out dependencies between input files in the CSV format. That is, they print out the information as to which file depends on which file to use which symbol. We added this feature with a few use cases in mind. First, you can use this to analyze why some object file was pulled out from an archive and got linked to an output file. Second, when you want to eliminate all dependencies to some library, you can find all of them very easy with this feature. Note that this is an experimental feature and may change or removed in feature releases of mold. (a1287c26b97d207850e88bc8147c85e63bdff92a) - The following options are added:
--warn-once
(f24b99750102eb32f717a9a4153a7cb14120220b),--warn-textrel
(6ffcae428622c216b5f77384a7456fa248981d7c) - Runtime dependency to
libxxhash
has been eliminated. (e5f4b967ed9339fc215dadcef62d656c6d98228a)
Bug fixes and compatibility improvements
- A
PT_GNU_RELRO
segment is now aligned up to the next page boundary. Previously, mold didn't align it up, and the runtime loader align it down, so the last partial page would not be protected by the RELRO mechanism. Now, the entire RELRO segment is guaranteed to be read-only at runtime. (0a0f9b3ad5ef787fa4d318846ba1641ffc180769) - The
.got.plt
section is now protected by RELRO if-z now
is given. This is possible because writes to.got.plt
happen only during process startup if all symbols are resolved on process startup. (73159e241d6c34d76857fe0bfaf0da5069b412c4) - Previously, mold reported an error if object files created with old GCC (with
-fgnu-unique
) are mixed with ones created with newer GCC or Clang (with-fno-gnu-unique
) (https://github.com/rui314/mold/issues/324). Now, mold accepts such input files. (e65c5d2a1c2484927beb98669c552433b7dc98fd) - mold can now be built with musl libc. (42b7eb87a1194f2aac36d55930be325c2dac2044)
- mold-generated
.symtab
section now contains section symbols and symbols derived from input shared object files. (e4c03c238e656cd10955acb424b50ccdec1bd9a5, 1550b5affffd221a9c23de740252174a504c2949) - mold-generated executables can now run under valgrind. Previously, valgrind aborted on startup due to an assertion failure because it didn't expect for an executable to have both
.bss
and.dynbss
sections. mold generated.dynbss
to contain copy-relocated symbols. The section has been renamed.copyrel
to workaround the valgrind's issue. (0f8bf23bcf52d119ac329d28dce5d562235f6503)
1、 mold-1.1-aarch64-linux.tar.gz 2.92MB
2、 mold-1.1-x86_64-linux.tar.gz 3.15MB