1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-04 16:48:04 +03:00
Commit Graph

514 Commits

Author SHA1 Message Date
Rui Ueyama
d123009460 [Mach-O] Add a test 2021-09-28 21:55:37 +09:00
Rui Ueyama
9d805f5d26 [Mach-O] Make make test to work on macOS 2021-09-28 18:47:24 +09:00
Rui Ueyama
774fc0f340 [ELF] Remove an extra space in an error message 2021-09-26 12:43:39 +09:00
Rui Ueyama
e4861bb3e1 [ELF] Fix "recompile with -fPIC" error
mold used to emit a spurious "recompile with -fPIC" error when creating
a position-dependent executable. This is because we alwyas create
dynamic relocations for importe symbols. If the relocated place is
read-only, we can't apply a dynamic relocation, and we printed out the
error message.

This patch fixes the issue by creating copy relocations and PLTs for
such symbols.

Fixes https://github.com/rui314/mold/issues/116
2021-09-25 18:13:26 +09:00
Rui Ueyama
5ea876ff2f [Mach-O] wip 2021-09-15 21:00:34 +09:00
Rui Ueyama
08b61f29d2 [ELF] Add --require-defined 2021-09-12 18:34:42 +09:00
Rui Ueyama
1cb750a649 [ELF] Add -Bno-symbolic 2021-09-11 21:41:17 +09:00
Rui Ueyama
8f10ac5047 [Mach-O] Add a test for mach-o stub 2021-09-08 19:19:07 +09:00
Rui Ueyama
5dab8612c8 Move ELF tests to test/elf directory 2021-09-08 19:13:18 +09:00
Rui Ueyama
bfa24a3205 Create temporary files for tests under out/ 2021-09-08 19:08:52 +09:00
Rui Ueyama
b39a47a759 Promote weak undefs to dynamic symbols if building DSO
475a250ad4 changed mold's behavior on
weak undefined symbols, so that if they are not resolved within the
current ELF module, they are resolved to address zero. Previously,
they would be promoted to dynamic symbols to give then another chance
to be resolved at runtime.

That change caused a regression in Firefox. Firefox uses weak undef
symbols as a mean to export symbols from libxul.so. Quote from
Firefox's mfbt/Types.h:

> On linux mozglue is linked in the program and we link libxul.so with
> -z,defs. Normally that causes the linker to reject undefined references in
> libxul.so, but as a loophole it allows undefined references to weak
> symbols. We add the weak attribute to the import version of the MFBT API
> macros to exploit this.

So, they use this as a "loophole".

This change partially revert 475a250ad4.
Now, remaining weak undefs are resolved to address zero only when we
are creating an executable.

Fixes https://github.com/rui314/mold/issues/114
2021-09-06 20:47:16 +09:00
Rui Ueyama
b3d0ee093b Report the "recompile with -fPIC' error correctly 2021-08-30 21:07:27 +09:00
Rui Ueyama
d3577550d2 Fix filename typo 2021-08-30 20:52:28 +09:00
Rui Ueyama
c50dd18881 Fix an issue that local symbols are exported
We sometimes put local symbols into .dynsym, but if they are
global symbols hidden by a version script, they were exported
from .dynsym. This patch correctly makes them local symbols.
2021-08-29 13:04:23 +09:00
Rui Ueyama
d06e2f71f3 Attempt to fix CI 2021-08-28 20:47:45 +09:00
Rui Ueyama
d43e43adbb Add a test 2021-08-28 14:50:19 +09:00
Rui Ueyama
475a250ad4 Do not promote unresolved weak undefs to dynamic symbols
Previously, we try to promote unresolved weak undefined symbols to
dynamic symbols so that they will get another chance to be resolved at
runtime. This is not always doable. Consider the following two cases:

 - There's a relocation that directly refers a weak undefined symbol

 - There's a relocation that is in a read-only section

In the former case, we need to create a copy relocation, but we can't
do that against a weak undef becasue a weak undef doesn't have the notion
of the symbol size.

In the latter case, we need to create a dynamic relocation, but such
dynamic relocation would fail at load-time when the runtime linker tries
to mutate the contents of a read-only section.

So, we had a logic to detect the above cases and promote weak undefs
only when they can be promoted. But the logic is not as robust as I
hoped. So, in this patch, I removed the logic and stop promoting weak
undefs.
2021-08-27 12:50:23 +09:00
Rui Ueyama
684962b84c Support TLSGD relocations for AArch64 2021-08-24 06:29:04 +00:00
Rui Ueyama
5912a0022f Fix CI 2021-08-23 18:40:05 +09:00
Rui Ueyama
f0f40d073b Fix tests for AArch64 2021-08-23 09:21:31 +00:00
Rui Ueyama
bb1ec6177f Fix TLSDESC relocations against imported symbols
Such relocations shouldn't be relaxed to local-exec, as they are
not local.
2021-08-23 13:38:53 +09:00
Rui Ueyama
7f943d1445 Implement TLSDESC relaxation for AArch64 2021-08-23 03:24:18 +00:00
Rui Ueyama
4c710df347 Fix TLSDESC relocations for statically-linked executables
We shouldn't create TLSDESC dynamic relocations for statically-
linked executables because such executables don't contain the
tranpoline function needed for TLSDESC. Instead, we should
always relax these relocations.
2021-08-22 22:01:38 +09:00
Rui Ueyama
3c79d672dc Implement TLSDESC for AArch64 2021-08-22 11:34:22 +00:00
Rui Ueyama
a82bc71088 Fix test/nocopyreloc.sh for AARCH64 2021-08-22 10:33:38 +00:00
Rui Ueyama
96589d4acf Allow to put local symbols to .dynsym
We used to write only global symbols to .dynsym because, in most
use cases, .dynsym are used for resolving inter-module dependencies.
However, we need to put local symbols to .dynsym if they are thread-
local symbols.
2021-08-22 19:28:37 +09:00
Rui Ueyama
f570c4e9e8 Fix tests for AARCH64 2021-08-20 09:48:10 +00:00
Rui Ueyama
2a3639a7d8 Fix tests for AARCH63 2021-08-19 12:31:23 +00:00
Rui Ueyama
34558f410d Do not generate dynrels against RO sections for weak undef symbols
Previously, we created dynamic relocations against read-only sections
if the sections contain relocations against weak undefined symbols.
Since such dynamic relocations cannot be applied at load-time, the
generated executables failed with SEGV.

Now, such relocations are resolved to address 0.

Reported at https://github.com/rui314/mold/pull/110
2021-08-17 17:23:22 +09:00
Rui Ueyama
035aa73c43 Fix CI 2021-07-28 23:40:29 +09:00
Rui Ueyama
d25c2553ad Intercept all invocations of ld, ld.gold or ld.lld
Previously, only /usr/bin/ld, /usr/bin/ld.lld and /usr/bin/ld.gold
were intercepted. Now, mold ignores the directory part when comparing
a command name with `ld`, `ld.lld` or `ld.gold`.

This change is made because ld is often installed other than /usr/bin.

Fixes https://github.com/rui314/mold/issues/101
2021-07-28 22:42:35 +09:00
Rui Ueyama
965da0af4a Use hyphen instead of underscore in filename
Test files are following this convention already, but source files weren't.
2021-07-26 21:34:04 +09:00
Rui Ueyama
73d1dcac5d Add a test 2021-07-26 21:32:34 +09:00
Rui Ueyama
79787360c6 Fix test
This piece of code is intended to be position-independent,
but it actually directly called printf without PLT.

Fixes https://github.com/rui314/mold/issues/100
2021-07-26 20:17:28 +09:00
Rui Ueyama
6fa659c41b Remove an argument from test scripts 2021-07-21 16:27:29 +09:00
Rui Ueyama
271c9151f4 Disable tests for mold-wrapper if ASAN is enabled
ASAN doens't work well if other libraries are LD_PRELOAD'ed.
2021-07-20 13:32:02 +09:00
Rui Ueyama
59822bf07e Attempt to fix CI 2021-07-20 00:43:14 +09:00
Rui Ueyama
fe26dad744 Fix cmake build
You can now build mold with the following commands:

  $ mkdir -p out/debug
  $ cd out/debug
  $ cmake -GNinja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug ../..
  $ ninja

To run tests, use the following commands:

  $ cd out/debug
  $ ctest -j$(nproc)
2021-07-20 00:33:28 +09:00
Rui Ueyama
04e9aa4ebc Skip i386/aarch64 tests if cross compilers are not available
https://github.com/rui314/mold/issues/89
2021-07-17 01:23:58 +09:00
Rui Ueyama
280892f061 Fix tests for musl 2021-07-16 15:30:54 +09:00
Rui Ueyama
d79cdb8371 Fix a broken test
Fixes https://github.com/rui314/mold/issues/89
2021-07-13 19:24:26 +09:00
Artur Sinila
5fb7ecbd03
Fix test/run.sh for cases when /usr/bin/ld -> /usr/bin/mold
Signed-off-by: Artur Sinila <freesoftware@logarithmus.dev>
2021-07-12 05:27:21 +03:00
Rui Ueyama
3204bb01d9 Fix function pointer equality
Previously, a GOT relocation (e.g. R_X86_64_REX_GOTPCRELX) and a
R_X86_64_64 relocation referring the same imported symbols were
resolved to different addresses. Here is why:

 - When we saw a R_X86_64_64 relocation against an imported symbol,
   we created a PLT and resolve the relocation there.

 - GOT relocation is resolved to a GOT entry, which has a true
   address of an imported function at runtime, which is different
   from PLT entries that redirect calls to the real function.

With this patch, we no longer create a PLT entry for R_X86_64_64.
Instead, we emit a dynamic relocation so that it is always resolved
to a real function address.

Fixes GNU MP's `make check` failure, which was reported at
https://github.com/rui314/mold/issues/81
2021-07-10 17:54:57 +09:00
Rui Ueyama
faac31f217 Support VERSION linker script command
The grammar of the command is this

  VERSION { <version-script> }

where <version-script> is a version script you can specify with
the --version-script option.
2021-07-09 23:34:44 +09:00
Rui Ueyama
63b6d30876 Compress .repro section contents
Previously, .repro contains an uncompressed tar file containing all
input files. This patch compresses the contents in the gzip format.
2021-07-09 00:47:15 +09:00
Rui Ueyama
50b7497e19 Align section header to a E::wordsize boundary
Fixes https://github.com/rui314/mold/issues/80
2021-07-08 15:58:55 +09:00
Rui Ueyama
84d9e4d5ac Fix regexp 2021-07-07 23:12:24 +09:00
Rui Ueyama
72cc07fb42
Merge pull request #83 from nehaljwani/dynsym-IFUNC
Do not replace IFUNC with FUNC in .dynsym
2021-07-07 21:48:15 +09:00
Rui Ueyama
6ae115ac69 Support R_AARCH_ABS{32,64} relocations 2021-07-07 21:06:18 +09:00
Nehal J Wani
1aec54efdb
Do not replace IFUNC with FUNC in .dynsym
This is a partial revert of dd04357

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
2021-07-07 07:59:51 -04:00
Rui Ueyama
e3dccd0157 Add a test 2021-07-07 20:38:48 +09:00
Rui Ueyama
6d6df45a23 Fix definition of __GLOBAL_OFFSET_TABLE__ for AArch64 2021-07-07 12:51:23 +09:00
Rui Ueyama
d4a67f6f38 Disable an AArch64 test 2021-07-06 23:06:02 +09:00
Rui Ueyama
41497d7990 Support AARCH64 relocations
With this change, mold can now create a "Hello world" program
for the AArch64 target.
2021-07-06 22:24:48 +09:00
Nehal J Wani
be6d443bc8
[tests] Improve test for -spare-dynamic-tags
The default size and offsets of the .dynamic section are not necessarily
same with different builds of clang. For example, some builds can make
clang pass --hash-style=gnu to the linker and some --hash-style=both.

This change updates the test to compute the difference in size of the
.dynamic section before and after using the flag -spare-dynamic-tags,
making it independent of the compiler build.

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
2021-07-03 22:35:42 -04:00
Rui Ueyama
accf96877f Add a stub for AArch64
It can generate an executable, but generated executable won't run
correctly because we don't process relocations at all yet.
2021-07-03 21:39:44 +09:00
Rui Ueyama
d502b6ec60 Initial AARCH64 support 2021-07-03 20:48:38 +09:00
Rui Ueyama
3c992c02ea
Merge pull request #72 from nehaljwani/fix-pie-test
[tests] Fix pie test when cc isn't built with --enable-default-pie
2021-07-03 14:30:05 +09:00
Rui Ueyama
2abca8b5c1 Fix tests for non-Ubuntu-20 systems
Fixes https://github.com/rui314/mold/issues/67
2021-07-03 14:26:38 +09:00
Nehal J Wani
3208ceaac6
[tests] Fix pie test when cc isn't built with --enable-default-pie
mold: /__w/mold/mold/test/tmp/pie/a.o:(.text): R_X86_64_32 relocation
       against symbol `.rodata' can not be used; recompile with -fPIE
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
2021-07-03 01:05:28 -04:00
Rui Ueyama
475fad3a78 Allow sysroot to be a relative path
Chromium cannot be built with out this patch.
2021-07-03 12:02:32 +09:00
Rui Ueyama
0fd62ce693 Fix sysroot handling
Fix https://github.com/rui314/mold/issues/59
2021-07-01 17:40:45 +09:00
Rui Ueyama
9abfeee0e3 Split a function and add tests 2021-07-01 10:00:08 +09:00
Rui Ueyama
6432114e2a Fix handling of --sysroot
Fixes https://github.com/rui314/mold/issues/59
2021-06-30 22:15:19 +09:00
Rui Ueyama
989f69fdc5 Do not apply version scripts to DSO symbols
This is needed by Gentoo's dev-perl/Image-Imlib2-2.30.0-r1 package
because this fixes a mis-link issue of libbsd.
2021-06-27 21:44:42 +09:00
Rui Ueyama
5761dbc399 Fix a broken test 2021-06-27 17:03:59 +09:00
Rui Ueyama
570a3556c5 Fix exported weak symbol
This is needed by Gentoo's app-admin/filebeat-7.9.3 package.
2021-06-27 12:37:14 +09:00
Rui Ueyama
4436e4a57d Improve error message for an attempt of LTO 2021-06-26 15:05:05 +09:00
Rui Ueyama
bd1b044afc Accept extern "C" in version script
This is needed by Gentoo's dev-libs/opencl-clang-10.0.0.1-r1 package.
2021-06-25 16:48:40 +09:00
Rui Ueyama
2e5088a001 Fix common symbol
This is needed by Gentoo's sci-electronics/voacapl-0.7.6 package.
2021-06-25 15:42:16 +09:00
Rui Ueyama
bd8059a366 Fix an issue that a .dynsym for PLT refers itself 2021-06-25 13:33:14 +09:00
Rui Ueyama
5046fae0cf Do not directly call imported functions
This is needed by Gentoo's sci-libs/lapack-3.9.0-r1 package.
2021-06-25 01:05:57 +09:00
Rui Ueyama
d9ecc2e3e6 Promote weak undefined symbols to weak dynamic symbols
Previously, if a weak undefined symbol cannot be resolved within
an output of the linker, mold turned it into an absolute symbol
with value 0. However, other linkers export such symbols as a
weak dynamic symbol, so that the symbol gets another chance to be
resolved at runtime.

This patch implements the behavior.

This is needed by Gentoo's dev-libs/nsync-1.20.1 package.
2021-06-25 00:44:35 +09:00
Rui Ueyama
fd1855a67b Make --version to exit immediately
This is needed by Gentoo's dev-lang/spidermonkey-78.10.1 package,
as its configure script assumes that the linker exit normally
even if extra options are given after `--version`.
2021-06-24 16:45:04 +09:00
Rui Ueyama
81dbbdda62 DSOs referenced by used DSOs are considered used
This is needed by Gentoo's sys-cluster/ampi-0_pre20140616 package.
2021-06-24 15:54:25 +09:00
Rui Ueyama
de668b125a Refactor 2021-06-24 15:50:08 +09:00
Rui Ueyama
dd04357363 Do not set STT_GNU_IFUNC to symbols .dynsym
We should not set STT_GNU_IFUNC to symbols in .dynsym because
from the other ELF module's point of view, it doens't matter
whether a symbol is IFUNC or not.

This is needed by Gentoo's sci-mathematics/nauty-2.6.7 package.
2021-06-21 10:32:30 +09:00
Rui Ueyama
f127281d05 Allow empty input files
mmap(2) fails if you pass 0 as an argument for `length` parameter,
so this case has to be handled as a special case.

This is needed by Gentoo's media-plugins/calf-0.90.3-r1 package.
2021-06-21 09:33:35 +09:00
Rui Ueyama
d3d056d27a Do not register common symbols as lazy symbols
In other words, a linker shouldn't pull out an object file from an
archive to resolve an existing undefined or a common symbol with a
common symbol.

This is needed by Gentoo's app-arch/dump-0.4.47 package.
2021-06-21 08:36:16 +09:00
Rui Ueyama
1bac9c7b8d Add -z nodump
This is needed by Gentoo's sci-libs/indilib-1.8.9 package.
2021-06-21 06:56:07 +09:00
Rui Ueyama
7a689d8361 Handle ar header alignment correctly 2021-06-20 21:29:10 +09:00
Rui Ueyama
4f92d7f19b Add -z origin
This is needed by Gentoo's dev-ada/gnatcoll-bindings-2020-r1 package.
2021-06-20 14:42:43 +09:00
Rui Ueyama
9519e4ce20 Change how to handle --unresolved-symbols=ignore
Previously, we turned unresolved undefined symbols into dynamic
symbols. This patch changed the behavior so that such symbols
are turned into non-dynamic absolute symbols with value zero.

This change is needed by Gentoo's dev-libs/wayland-protocols-1.21
package.
2021-06-20 14:31:36 +09:00
Rui Ueyama
793136a8f0 Give common symbols in archive files higher priority
If an object file in an static archive contains a common symbol
that can be used to resolve an undefined symbol, mold now pulls
out that object file from the archive. Previously, we ignore such
common symbols.

Object files generated by a Fortran compiler often contain a lot of
common symbols, and this change makes a difference.

Fixes Gentoo's sci-astronomy/wcslib-7.3 package, which contains a
program written in Fortran.
2021-06-19 21:42:21 +09:00
Rui Ueyama
1d16374763 Fix a test 2021-06-19 12:34:20 +09:00
Rui Ueyama
a0ecd0c8dc Add --unique=PATTERN
This is needed by Gentoo's sys-fabric/infinipath-psm-3.2 package.
2021-06-19 01:09:26 +09:00
Rui Ueyama
bd858faf94 Add --unresolved-symbols
This is needed by Gentoo's dev-libs/wayland-protocols-1.21 package.
2021-06-18 15:51:57 +09:00
Rui Ueyama
725834e0b1 Do not garbage-collect C-identifer sections
This is needed for Gentoo's sys-fs/udev-245.5-r1 package.
2021-06-18 12:57:12 +09:00
Rui Ueyama
37b88e3f5a Do not set executable bit for --relocatable outputs 2021-06-18 01:45:38 +09:00
Rui Ueyama
2203644a3b Fix section addresses
This is needed for Gentoo's net-libs/nodejs-14.16.1 package.
2021-06-17 23:48:31 +09:00
Rui Ueyama
e88dddb820 Add -z {text,notext,textoff] 2021-06-17 14:18:44 +09:00
Rui Ueyama
4e2b6fd315 Handle thin archives containing absolute paths 2021-06-17 14:18:44 +09:00
Rui Ueyama
22ca6bc288 Ignore --verbose 2021-06-17 14:18:44 +09:00
Rui Ueyama
59e971b61f Ignore empty symbol version
This is needed for Gentoo's sys-fs/mhddfs packages.
2021-06-16 22:41:50 +09:00
Rui Ueyama
e1a964acb2 Do not write duplicate entries to .dynsym
Fixes Gentoo's sys-libs/slang package.
2021-06-16 19:50:42 +09:00
Rui Ueyama
e7019ebf86 Add -z keep-text-section-prefix 2021-06-16 19:50:08 +09:00
Rui Ueyama
a715197be4 Export more symbols from executable if they could overwrite dso syms 2021-06-15 01:47:53 +09:00
Rui Ueyama
bc2ece0474 Fix --relocatable 2021-06-14 13:48:26 +09:00
Rui Ueyama
333843a33d Add --warn-unresolved-symbols and --error-unresolved-symbols 2021-06-14 00:04:07 +09:00
Rui Ueyama
4f31c22fac Fix output section name 2021-06-13 16:51:48 +09:00
Rui Ueyama
9cc309af75 Implement --relocatable
Fixes https://github.com/rui314/mold/issues/46
2021-06-11 21:57:43 +09:00
Rui Ueyama
98dbddaa77 Ignore .gnu.warning.* sections 2021-06-07 22:35:32 +09:00
Rui Ueyama
3324acafc5 Rename --icf to --icf=all for compatibility with lld and gold 2021-06-07 21:55:08 +09:00
Rui Ueyama
8bf21f9ea0 Report an error for unknown -z flags 2021-06-07 20:53:35 +09:00
Rui Ueyama
6d13fe2e7f Add -z muldefs as an alias to --allow-multiple-definition 2021-06-07 20:48:06 +09:00
Rui Ueyama
8833dcbcb0 Fix relocations for i386 PIC 2021-06-07 18:37:50 +09:00
Rui Ueyama
a0c3fcb1bb Do not put local symbols to .dynsym 2021-06-06 17:24:49 +09:00
Rui Ueyama
fc54693be5 Fix zlib-gnu-style compressed section decoding 2021-06-05 20:51:21 +09:00
Rui Ueyama
ee3b0293fd Rename an envvar 2021-06-04 20:32:58 +09:00
Rui Ueyama
6e7baef8d3 Set DT_RELACOUNT field 2021-06-04 20:04:30 +09:00
Rui Ueyama
b0b2406d84 Set the entry address to .text if entry point symbol is not defined 2021-06-04 15:30:32 +09:00
Rui Ueyama
b5c68b465e Revert "Change the default build-id size from 20 to 16 bytes"
This reverts commit fe76210da6
because I misunderstood the actual default size of build-id
of the GNU linkers.
2021-06-04 12:32:28 +09:00
Rui Ueyama
d3923b9f27 Weak symbols shouldn't keep as-needed DSOs
If all references to an DSO are weak, the DSO shouldn't be considered
being used in terms of --as-needed. This is needed for GNU ld compatibility.
2021-06-04 12:24:25 +09:00
Rui Ueyama
3fb870c80b Add --compress-debug-info=zlib-gnu 2021-06-03 23:57:06 +09:00
Rui Ueyama
fe76210da6 Change the default build-id size from 20 to 16 bytes
GNU ld's default build-id size is 16.
2021-06-03 22:14:55 +09:00
Rui Ueyama
f9e91aa391 Do not embed a library fullpath if it is given by -l 2021-06-01 15:15:25 +09:00
Rui Ueyama
1f3931fc9e Do not put non-alloc NOTE section into a PT_LOAD segment
This bug caused a test failure of Gentoo's dev-lang/go-1.16.4
paackage. Specifically, `go tool dist test testshared` failed
due to this bug.
2021-06-01 00:53:06 +09:00
Rui Ueyama
8219fdd688 Simplify input file priority
This change is required to build Gentoo's net-libs/libtorrent-0.13.8-r1
package with FEATURES=test, e.g.

  $ FEATURES=test emerge net-libs/libtorrent
2021-05-31 17:09:40 +09:00
Rui Ueyama
8940abf807 Sort .{init,fini}_array and .[cd]tors 2021-05-31 01:11:45 +09:00
Rui Ueyama
02fa969295 Place .ctors and .dtors into .init_array and .fini_array
This change is needed to build Gentoo's dev-lang/gprolog-1.4.5,
which is the GNU Forth package. GNU Forth creates ELF objects
itself, and it still uses .ctors and .dtors as opposed to .init_array
and .fini_array.
2021-05-30 22:05:07 +09:00
Rui Ueyama
ed98211a24 Allow to refer unversioned symbol within an object file
Previously, mold couldn't handle an object file which contains
versioned symbol `foo@@SOME_VERSION` that also has an undefined
symbol `foo`. Now, `foo` is resolved to `foo@@SOME_VERSION`.

This change is required to build Gentoo's media-libs/alsa-lib-1.2.3.2-r1
package.
2021-05-30 18:03:21 +09:00
Rui Ueyama
a2017e5d3a Skip incompatible library files
This change is required to build Gentoo's net-libs/libtorrent-0.13.8-r1
package.
2021-05-29 20:47:16 +09:00
Rui Ueyama
3cfbc0d66c Parallelize tests 2021-05-29 16:05:38 +09:00
Rui Ueyama
c805f7c087 Fix broken tests 2021-05-29 14:20:56 +09:00
Rui Ueyama
fbed89948c Add -R as an alias for -rpath
This change is required to build Gentoo dev-erlang/stringprep package.
2021-05-29 13:42:10 +09:00
Rui Ueyama
6b10fbd834 Add end, etext and edata symbols 2021-05-29 02:07:46 +09:00
Rui Ueyama
8fe15c8dc8 Make linker-synthesized symbols to overwrite other symbols 2021-05-29 00:31:40 +09:00
Rui Ueyama
de7ba9014f Add "GNU gold" to the --version string
The configure script in Gentoo's dev-libs/jansson-2.13.1-r1 package
treats mold 0.1.1 as GNU ld 0.1.1, which is from 1980s if existed.

Adding "GNU gold" to the help message solves the nasty issue, as the
configure script considers any version of GNU gold supports modern
features.
2021-05-27 15:24:30 +09:00
Rui Ueyama
310980fb7e Add --retain-symbols-file 2021-05-27 00:31:08 +09:00
Rui Ueyama
8dd0accc89 Do not exit immediately on --version 2021-05-23 18:22:20 +09:00
Rui Ueyama
3fab4ce3d2 Add missing dependencies 2021-05-23 16:20:55 +09:00
Rui Ueyama
a0a94f4637 Add -wrap option 2021-05-22 01:54:08 +09:00
Rui Ueyama
b9ab55dfa7 Add --image-base 2021-05-21 18:37:38 +09:00
Rui Ueyama
99abd52d6e Fix a broken test 2021-05-21 12:43:34 +09:00
Rui Ueyama
02e6c6ab5d Make -run to intercept not only ld but also ld.lld and ld.gold 2021-05-20 14:14:35 +09:00
Rui Ueyama
968cfd0dcd Simplify 2021-05-19 10:24:39 +09:00
Rui Ueyama
ad6aa32b41 Handle mold -run /usr/bin/ld 2021-05-14 22:55:04 +09:00
Rui Ueyama
76b0afc6b7 Add --omagic 2021-05-10 19:21:29 +09:00
Rui Ueyama
6014faec2a Add -V option 2021-05-10 16:53:16 +09:00
Rui Ueyama
4a3480e1af readlink() doesn't terminate a string with NUL 2021-05-10 16:40:51 +09:00
Rui Ueyama
ccd27807aa Do not add unreferenced DSO symbols to .dynsym 2021-05-10 15:50:25 +09:00
Rui Ueyama
033834a28e Add --help 2021-05-08 20:10:41 +09:00
Rui Ueyama
13003d2479 Add --compress-debug-sections 2021-05-06 17:20:07 +09:00
Rui Ueyama
ebe6cca2e6 Create a .repro section if MOLD_REPRO environment variable is set 2021-05-02 20:49:00 +09:00
Rui Ueyama
d11c383147 Replace --reproduce with --repro 2021-05-02 20:49:00 +09:00
Rui Ueyama
5ec4ffced4 Fix test 2021-05-01 19:34:49 +09:00
Rui Ueyama
7977909c0a Merge .note.gnu.property 2021-05-01 15:42:35 +09:00
Rui Ueyama
34462cf473 Emit UUIDv4 if --build-id=uuid is specified 2021-04-28 19:54:40 +09:00
Rui Ueyama
b1ca02b276 Handle - as stdout 2021-04-28 19:15:20 +09:00
Rui Ueyama
d28b6e0a52 Fix https://github.com/rui314/mold/issues/32 2021-04-24 14:27:50 +09:00
Rui Ueyama
8b0831c84c wip 2021-04-17 23:50:33 +09:00
Rui Ueyama
8a2691cfe5 Revert "Revert "wip""
This reverts commit ad85fbd02b.
2021-04-17 23:45:40 +09:00
Rui Ueyama
2e7bd43a23 wip 2021-04-17 22:49:19 +09:00
Rui Ueyama
ad85fbd02b Revert "wip"
This reverts commit fe9d2dd365.
2021-04-17 22:14:15 +09:00
Rui Ueyama
9cf193011f wip 2021-04-17 16:23:37 +09:00
Rui Ueyama
fe9d2dd365 wip 2021-04-17 15:11:05 +09:00
Rui Ueyama
fa91fb1e10 Handle R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL 2021-04-14 15:01:52 +09:00
Rui Ueyama
9de278cf25 Handle R_386_TLS_GD, R_386_TLS_LDM and R_386_TLS_LDO_32 2021-04-13 22:25:11 +09:00
Rui Ueyama
f2232a1e7d wip 2021-04-12 02:45:33 +09:00
Rui Ueyama
09fc73a9f8 Add -spare-dynamic-tags 2021-04-11 15:43:23 +09:00
Rui Ueyama
8c4c17dc77 wip 2021-04-11 14:13:55 +09:00
Rui Ueyama
4da18565f5 wip 2021-04-11 14:01:00 +09:00
Rui Ueyama
f3ffb651fa wip 2021-04-11 13:16:11 +09:00
Rui Ueyama
019967d259 wip 2021-04-10 23:08:55 +09:00
Rui Ueyama
4418c93f49 Add -z lazy 2021-04-10 23:04:33 +09:00
Rui Ueyama
0a62c5c5c6 Add -z interpose 2021-04-10 18:18:56 +09:00
Rui Ueyama
ef01e7d7ee Add -z initfirst 2021-04-10 18:16:01 +09:00
Rui Ueyama
46d214cafa wip 2021-04-10 17:59:15 +09:00
Rui Ueyama
b7791b2a03 wip 2021-04-10 15:58:25 +09:00
Rui Ueyama
4dc0918a34 wip 2021-04-10 15:33:51 +09:00
Rui Ueyama
03c9344ba0 wip 2021-04-06 17:55:05 +09:00
Rui Ueyama
92725015a5 wip 2021-04-01 18:49:16 +09:00
Rui Ueyama
197e9fafd7 wip 2021-04-01 01:34:54 +09:00
Rui Ueyama
6da1e8c50c wip 2021-04-01 01:18:01 +09:00
Rui Ueyama
b55d68365a wip 2021-04-01 00:52:10 +09:00
Rui Ueyama
f9af6357df wip 2021-03-31 20:18:12 +09:00
Rui Ueyama
97f02b1eb3 wip 2021-03-31 20:13:36 +09:00
Rui Ueyama
c6cd07a2c5 Make "hello world" work for i386 2021-03-31 17:57:51 +09:00
Rui Ueyama
f9f0d90791 wip 2021-03-31 14:18:10 +09:00
Rui Ueyama
a3d2743a17 wip 2021-03-31 01:49:32 +09:00
Rui Ueyama
e6a4002c60 wip 2021-03-31 00:11:39 +09:00
Rui Ueyama
fe77f277d3 wip 2021-03-30 23:47:01 +09:00
Rui Ueyama
a7e826a936 Embed argv to .comment 2021-03-29 13:36:26 +09:00
Rui Ueyama
bb315af2aa Support extern "C++" in version script 2021-03-27 16:09:54 +09:00
Rui Ueyama
f13b7db5c4 Fix TPOFF32 relocation handling 2021-03-27 14:47:30 +09:00
Rui Ueyama
5a51e06fa1 Handle object files with lots of sections correctly 2021-03-27 09:12:52 +09:00
Rui Ueyama
907dd6a341 wip 2021-03-26 22:14:23 +09:00
Rui Ueyama
c224435187 wip 2021-03-26 15:52:57 +09:00
Rui Ueyama
f89e0aa367 wip 2021-03-25 18:15:53 +09:00
Rui Ueyama
60029b028f Place common symbols into .common section 2021-03-25 17:55:59 +09:00
Rui Ueyama
fe626ed878 wip 2021-03-25 12:38:40 +09:00
Rui Ueyama
6536f0af17 Add -fatal-warnings 2021-03-24 01:35:26 +09:00
Rui Ueyama
e7f1a86586 Output warning message to stderr 2021-03-24 01:23:53 +09:00
Rui Ueyama
4519f8660c Add -warn-common 2021-03-24 01:16:32 +09:00
Rui Ueyama
802f4229c2 Handle common symbols 2021-03-24 01:12:26 +09:00
Rui Ueyama
275a578204 Embed GIT commit hash to binary 2021-03-23 21:15:32 +09:00
Rui Ueyama
4485de811a Do not create a copy relcations against a protected symbol 2021-03-23 15:21:59 +09:00
Rui Ueyama
16cd35999f wip 2021-03-23 14:46:59 +09:00
Rui Ueyama
031e978bc6 Do not emit .got, .got.plt or .rela.got if empty 2021-03-23 11:02:13 +09:00
Rui Ueyama
f56215aae1 wip 2021-03-22 15:33:39 +09:00