1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-11 16:58:12 +03:00
Commit Graph

2402 Commits

Author SHA1 Message Date
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
a8ebb63b00 Create text relocations instead of copy relocations
This is needed by Gentoo's dev-lang/gnat-gpl-2019-r2 package.
2021-06-25 00:31:54 +09:00
Rui Ueyama
4787363651 Ignore --warn-constructors
This is needed by Gentoo's sys-apps/memtest86-4.3.7-r2 package.
2021-06-24 19:54:43 +09:00
Rui Ueyama
00c907158c Ignore -z {no,}combreloc
This is needed by Gentoo's sys-boot/refind-0.12.0-r1 package.
2021-06-24 19:24:00 +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
04dcfe2ae3 Ignore -warn-once
This is needed by Gentoo's dev-embedded/gputils-1.5.0 package.
2021-06-21 09:44:09 +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
c876849144 Allow R_386_GOTPC relocations in non-allocated sections
This is not logically correct, because PC-relative offsets
make sense only against allocated sections. However,
this is needed by Gentoo's dev-lang/gnat-gpl-2018-r3 package.
2021-06-20 21:29:10 +09:00
Rui Ueyama
7a689d8361 Handle ar header alignment correctly 2021-06-20 21:29:10 +09:00
Rui Ueyama
83b14328ec Keep .ctors/.dtors sections if they are read from crtbegin.o or crtend.o
This is needed by Gentoo's dev-lang/gnat-gpl-2018-r3 package,
which still uses GCC7's CRT files.
2021-06-20 17:59:38 +09:00
Rui Ueyama
9a219c0048 Rename a variable 2021-06-20 16:22:01 +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
04f82b4b13 Fix Gentoo build script 2021-06-20 00:55:26 +09:00
Rui Ueyama
b21ade127c Simplify 2021-06-20 00:51:38 +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
9febec6c69 Rename a function 2021-06-19 20:29:16 +09:00
Rui Ueyama
2a5a15c858 Support global functions as exception handlers
Fixes a crash while building Gentoo's dev-lang/luajit-2.0.5-r3 package.
2021-06-19 12:37:18 +09:00
Rui Ueyama
1d16374763 Fix a test 2021-06-19 12:34:20 +09:00
Rui Ueyama
a690a88db7 Improve Gentoo test script 2021-06-19 12:33:41 +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
8571ce7c97 Fix assertion error
This is needed for Gentoo's net-misc/nx-3.5.99.25 package.
2021-06-17 15:09:24 +09:00
Rui Ueyama
219e6c92c3 Always create a .dynsym and .dynstr
This is needed for Gentoo's app-benchmarks/cpuburn-1.4a-r3 package.
2021-06-17 14:18:44 +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
f8359fdafd Handle STV_INTETRNAL as an alias to STV_HIDDEN
This is needed for Gentoo's media-libs/libuninameslist package.
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
eb8358e5d6 Tweak job timeout 2021-06-16 20:39:27 +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
1317132548 Update man page 2021-06-15 17:33:03 +09:00
Rui Ueyama
0280c39bc8 Document --{warn,error}-unresolved-symbols 2021-06-15 17:03:24 +09:00
Rui Ueyama
faee02060d Improve test script 2021-06-15 14:41:33 +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
9c784ce735 Update docker configs 2021-06-15 01:47:33 +09:00
Rui Ueyama
0aeb77f8e3 Extend timeout timer 2021-06-14 14:55:01 +09:00
Rui Ueyama
06eb4c0452 Embed mold command line to .comment only when MOLD_DEBUG is set 2021-06-14 13:49:58 +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