1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-06 01:28:12 +03:00
Commit Graph

3326 Commits

Author SHA1 Message Date
Rui Ueyama
092286fc1d [ELF] Fix tests so that they work if CC is clang 2022-01-07 12:45:20 +09:00
Rui Ueyama
9004c514da Suppress -Wformat-overflow GCC warning 2022-01-07 10:57:54 +09:00
Rui Ueyama
a27c113d35 Attempt to fix i386 host build
This change cherrypicks
542a27fa1c

https://github.com/rui314/mold/issues/240
2022-01-07 10:09:34 +09:00
Rui Ueyama
1acabd65e3 Add a comment 2022-01-06 23:42:15 +09:00
Rui Ueyama
2f86fef3a0 [ELF] Fix assertion failure
This patch fixes a regression introduced in
43fa021d48.

Fixes https://github.com/rui314/mold/issues/259
2022-01-06 22:01:56 +09:00
Rui Ueyama
79e397ea03 Add a missing #include 2022-01-06 20:54:23 +09:00
Rui Ueyama
daa88f2f06 [ELF] Handle '[]' in glob patterns
Previously, mold crashes due to an invalid regex pattern exception
when `[...]` is given as a version script pattern.

Fixes https://github.com/rui314/mold/issues/258
2022-01-06 20:45:46 +09:00
Rui Ueyama
404fa1288b [ELF] Add a test
https://github.com/rui314/mold/issues/258
2022-01-06 18:27:31 +09:00
Rui Ueyama
c33df4771f Revert "[ELF] Keep SHF_MERGE and SHF_STRINGS bits"
This reverts commit 4d78510cb0.

If the SHF_MERGE bit is set, sh_entsize must have the size of the unit
for that section. In the previous commit, we changed the behavior of
mold so that it sets SHF_MERGE bits in the output file. However, we
didn't set sh_entsize. So, the resulting section is technically invalid.

We merge sections with different sh_entsize into a single output
section, so there's no easy way to "keep" the original value.

In this commit, we simply revert the previous change so that mold won't
set SHF_MERGE in the output file.

https://github.com/rui314/mold/issues/155
2022-01-06 18:19:06 +09:00
Rui Ueyama
8f23d17ece Fix macOS build 2022-01-06 17:53:40 +09:00
Rui Ueyama
09b9d0af1d [ELF] Remove redundant code 2022-01-06 17:48:46 +09:00
Rui Ueyama
43fa021d48 [ELF] Do not place non-exported symbols into .gnu.hash
Previously, mold put all global symbols into .gnu.hash. Although I
believe it was not an error, it bloated the size of .gnu.hash because
.gnu.hash needs only exported symbols.

https://github.com/rui314/mold/issues/255
2022-01-06 17:47:19 +09:00
Rui Ueyama
907f713e51 [ELF] Remove NEEDS_DYNSYM flag from symbol
I wanted to make sure that a symbol X is in .dynsym if and only if
(X.is_imported || X.is_exported).
2022-01-06 15:27:39 +09:00
Rui Ueyama
276b9d005d [ELF] Add ARM64 to --help message
Fixes https://github.com/rui314/mold/issues/251
2022-01-05 21:41:53 +09:00
Rui Ueyama
fe14a08761 Make make to take EXTRA_CFLAGS and EXTRA_CXXFLAGS 2022-01-05 21:36:48 +09:00
Rui Ueyama
3865a10600
Merge pull request #252 from sicherha/fix-tests-on-aarch64
Fix test failures on aarch64
2022-01-05 21:07:26 +09:00
Christoph Erhardt
df865725ed Fix test failures on aarch64
Signed-off-by: Christoph Erhardt <github@sicherha.de>
2022-01-05 12:26:56 +01:00
Rui Ueyama
be49d673a5 [ELF] Deduce emulation from input files if -m is not given 2022-01-05 19:55:32 +09:00
Rui Ueyama
31a6a1164e
Merge pull request #248 from sina-ht/use-pkg-config
Use pkg-config to know where openssl header files reside
2022-01-05 18:40:55 +09:00
Hiroshi Takekawa
e8bdbaab22 Use pkg-config to know where openssl header files reside
Let Makefile know how to locate openssl header files in a directory other than
the default directories by using pkg-config. If you don't have pkg-config, then
$(shell) returns empty.

Signed-off-by: Hiroshi Takekawa <sian.ht@gmail.com>
2022-01-05 18:25:17 +09:00
Rui Ueyama
285c9e2c32 [ELF] Attempt to fix buildbots 2022-01-04 20:59:33 +09:00
Rui Ueyama
a5029d19a8 [ELF] Automatically fall back to ld.bfd or ld.lld if LTO is in use
This is very hacky but highly practical, so I couldn't resist to not
implement this. We should support LTO natively in the future. In the
meantime, this feature should work as a poor-man's replacement.

Fixes https://github.com/rui314/mold/issues/242
2022-01-04 20:50:16 +09:00
Rui Ueyama
0565a6a6ff
Merge pull request #241 from sina-ht/use-pkg-config
Use pkg-config to know where libcrypto resides
2022-01-04 15:05:34 +09:00
Hiroshi Takekawa
6987f06151 Use pkg-config to know where libcrypto resides
Let Makefile know how to link libcrypto in a directory other than the default
directories by using pkg-config. If you don't have pkg-config, then $(shell)
returns empty.

Signed-off-by: Hiroshi Takekawa <sian.ht@gmail.com>
2022-01-04 14:16:09 +09:00
Rui Ueyama
a2839f60dd [ELF] Improve an error message
Fixes https://github.com/rui314/mold/issues/233
2022-01-04 13:49:48 +09:00
Rui Ueyama
1bc7c332ab Do not link against librt on Android
Fixes https://github.com/rui314/mold/issues/231
2022-01-04 13:44:55 +09:00
Rui Ueyama
8ffe4cd472 [ELF] Ignore dead FDE entries
Looks like some CUDA object files contains FDEs whose relocation has
r_sym with value 0. Such FDEs are dead and should be ignored.

Unfortunately, there's no easy way to produce an object file containing
such relocation, so this change lacks a testcase.

Fixes https://github.com/rui314/mold/issues/235
2022-01-04 13:32:26 +09:00
Rui Ueyama
70704c7c09 Disable -Wc++11-narrowing on Android
Fixes https://github.com/rui314/mold/issues/231
2022-01-03 20:59:19 +09:00
Rui Ueyama
5029a6d044 Simplify 2022-01-03 20:56:59 +09:00
Rui Ueyama
9894b3173b [ELF] Add --default-symver
Fixes https://github.com/rui314/mold/issues/228
2022-01-03 20:29:33 +09:00
Rui Ueyama
4b2f10d009 [ELF] Improve test 2022-01-03 20:15:04 +09:00
Rui Ueyama
8590fd9947 Better way to suppress -Wint-to-pointer-cast 2022-01-03 18:15:51 +09:00
Rui Ueyama
7bb478b683 Fix macOS build 2022-01-03 18:05:33 +09:00
Rui Ueyama
ce2fee10b5 Use strerror_r() instead of strerror()
I have no idea why, but 2b818dbe44 made
mold's chrome link time slower by ~8%. This patch removes the use
of std::mutex.
2022-01-03 17:46:26 +09:00
Rui Ueyama
4033b53d7f
Merge pull request #232 from OctopusET/main
Fix build error on riscv64 (#222)
2022-01-03 16:39:38 +09:00
Rui Ueyama
8c0e2378c9 Update the man page 2022-01-03 16:19:43 +09:00
Moon Sungjoon
3fb54162d6 Fix build error on riscv64 (#222)
Patch from this PR: https://github.com/oneapi-src/oneTBB/pull/550

Signed-off-by: Moon Sungjoon <sumoon@seoulsaram.org>
2022-01-03 16:06:02 +09:00
Rui Ueyama
571a4f72a4
Merge pull request #230 from Cutlery-Drawer/mdoc
Rewrite manual page in `mdoc(7)`
2022-01-03 14:34:55 +09:00
Rui Ueyama
2b818dbe44 Use strerror() instead of strerror_r()
This should fix the build on Android.
Fixes https://github.com/rui314/mold/issues/231
2022-01-02 23:40:51 +09:00
Rui Ueyama
19dce5342f Fix -Wc++11-narrowing
Fixes https://github.com/rui314/mold/issues/231
2022-01-02 22:47:23 +09:00
Alhadis
632fe22240 Rewrite manual page in mdoc(7)
Signed-off-by: John Gardner <gardnerjohng@gmail.com>
2022-01-02 22:13:09 +11:00
Rui Ueyama
5618038463 [ELF] Show a better error message for the empty input file
Fixes https://github.com/rui314/mold/issues/227
2022-01-02 19:33:07 +09:00
Rui Ueyama
9178b762fc Refactor 2022-01-02 15:44:52 +09:00
Rui Ueyama
fea59750ed Do not use LTO to build oneTBB as it causes link failure 2022-01-02 12:52:01 +09:00
Rui Ueyama
fba4cb9114 Merge commit 'b82badd127f38f4fea6a4f1c0ec22900dd9dd8e3' as 'third-party/tbb' 2022-01-02 12:51:35 +09:00
Rui Ueyama
b82badd127 Squashed 'third-party/tbb/' content from commit 3df08fe23
git-subtree-dir: third-party/tbb
git-subtree-split: 3df08fe234f23e732a122809b40eb129ae22733f
2022-01-02 12:51:35 +09:00
Rui Ueyama
d3dc8a2377 Temporarily remove oneTBB to upgrade to v2021.5.0 2022-01-02 12:51:29 +09:00
Rui Ueyama
df24372775
Merge pull request #220 from rmcgibbo/main
[ELF] Fix parsing of --no-dynamic-linker on command line
2022-01-02 11:54:27 +09:00
Rui Ueyama
0a8231b59d [ELF] Support R_X86_64_GOTOFF64
Fixes https://github.com/rui314/mold/issues/224
2022-01-02 11:14:33 +09:00
Rui Ueyama
1f7727975c [ELF] Improve test 2022-01-02 11:13:12 +09:00