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

4353 Commits

Author SHA1 Message Date
Rui Ueyama
8d29501887 [Mach-O] Ignore OS name part of targets in TBD files 2022-07-02 13:57:12 +08:00
Rui Ueyama
ea308bc77b [Mach-O] Add -add_ast_path 2022-07-02 13:52:19 +08:00
Rui Ueyama
ad427f8629 [ELF] Skip one more test if musl
https://github.com/rui314/mold/issues/565
2022-07-01 19:05:32 +08:00
Rui Ueyama
23b90dfc38 [ELF] Detect musl libc in a more reliably way
Fixes https://github.com/rui314/mold/issues/565
2022-07-01 18:00:19 +08:00
Rui Ueyama
7f7d10cc89 Bump mold version to 1.3.1 2022-07-01 16:15:37 +08:00
Rui Ueyama
14392e7720 Fix a test for musl 2022-07-01 09:51:32 +08:00
Rui Ueyama
3b75398786 [ELF] Support .preinit_array
It looks like AddressSanitizer depends on this feature.

Fixes https://github.com/rui314/mold/issues/562
2022-06-30 16:29:50 +08:00
Rui Ueyama
5688115bb6
Merge pull request #561 from jpalus/armv6-libatomic
armv6 needs linking with libatomic as well
2022-06-29 20:58:42 +08:00
Jan Palus
b1d951a96f
armv6 needs linking with libatomic as well
mold: error: undefined symbol: __atomic_fetch_add_8
>>> referenced by compress.cc
>>>               out/compress.o:(void tbb::detail::d1::fold_tree<tbb::detail::d1::tree_node>(tbb::detail::d1::node*, tbb::detail::d1::execution_data const&))>>> referenced by arch-arm64.cc
>>>               out/elf/arch-arm64.o:(tbb::detail::d2::for_each_root_task_base<__gnu_cxx::__normal_iterator<mold:🧝:InputSection<mold:🧝:ARM64>**, std::span<mold:🧝:InputSection<mold:🧝:ARM64>*, 4294967295u> >, mold:🧝:create_range_extension_thunks(mold:🧝:Context<mold:🧝:ARM64>&, mold:🧝:OutputSection<mold:🧝:ARM64>&)::{lambda(mold:🧝:InputSection<mold:🧝:ARM64>*)#2}, mold:🧝:InputSection<mold:🧝:ARM64>*>::cancel(tbb::detail::d1::execution_data&))>>> referenced by arch-arm64.cc
>>>               out/elf/arch-arm64.o:(tbb::detail::d2::for_each_root_task_base<__gnu_cxx::__normal_iterator<mold:🧝:InputSection<mold:🧝:ARM64>**, std::span<mold:🧝:InputSection<mold:🧝:ARM64>*, 4294967295u> >, mold:🧝:create_range_extension_thunks(mold:🧝:Context<mold:🧝:ARM64>&, mold:🧝:OutputSection<mold:🧝:ARM64>&)::{lambda(mold:🧝:InputSection<mold:🧝:ARM64>*)#4}, mold:🧝:InputSection<mold:🧝:ARM64>*>::cancel(tbb::detail::d1::execution_data&))>>> referenced 971 more times

mold: error: undefined symbol: __atomic_load_8
>>> referenced by main.cc
>>>               out/elf/main.o:(mold:🧝:Context<mold:🧝:X86_64>::~Context())>>> referenced by output-chunks.cc
>>>               out/macho/output-chunks.o:(mold::macho::ExportEncoder::finish())>>> referenced by main.cc
>>>               out/elf/main.o:(mold:🧝:Context<mold:🧝:I386>::~Context())>>> referenced 3 more times

Signed-off-by: Jan Palus <jpalus@fastmail.com>
2022-06-29 14:08:55 +02:00
Rui Ueyama
ff1d5cd245 [Mach-O] Add -sectalign 2022-06-28 21:16:13 +08:00
Rui Ueyama
3bd972ad85 [Mach-O] Ignore -debug_variant 2022-06-28 20:09:04 +08:00
Rui Ueyama
575a59ef75 [Mach-O] Ignore -objc_abi_version 2022-06-28 20:06:25 +08:00
Rui Ueyama
9a0b7e826b [Mach-O] Add -dylib_install_name 2022-06-28 19:56:18 +08:00
Rui Ueyama
ded9cd4ffa Add -application_extension 2022-06-28 19:53:28 +08:00
Rui Ueyama
556e953045 Fix -Wdeprecated 2022-06-28 16:21:22 +08:00
Rui Ueyama
4a1d0dfc31 [Mach-O] Parallelize UUID computation 2022-06-28 16:13:22 +08:00
Rui Ueyama
73074389ed [Mach-O] Do not write x86-64 NOPs if ARM64 2022-06-28 15:49:29 +08:00
Rui Ueyama
b0c6aa9a0f [Mach-O] Add -add_empty_section 2022-06-28 15:20:47 +08:00
Rui Ueyama
883320d5e7 Refactor 2022-06-28 13:07:10 +08:00
Rui Ueyama
b81f3c22be Add a test 2022-06-28 11:35:36 +08:00
Rui Ueyama
26d45ed4c1 Fix a test
We passed two input files (/dev/null and "-") to the command which
is plainly wrong.

Fixes https://github.com/rui314/mold/issues/559
2022-06-28 10:42:26 +08:00
Rui Ueyama
b5d7335e35 Revert "Implement `--(no-)allow-shlib-undefined."
This reverts the following commits because it causes a regression.

 - 62be1fcdb0
 - a7b8da9345
 - 21a2d6bb6c

Fixes https://github.com/rui314/mold/issues/559
2022-06-27 20:53:26 +08:00
Rui Ueyama
bdee09ad02 [Mach-O] Handle LC_REEXPORT_DYLIB 2022-06-27 20:49:02 +08:00
Rui Ueyama
a6a03b5851 Refactor 2022-06-27 17:43:53 +08:00
Rui Ueyama
8aa05de5e3 Refactor 2022-06-27 16:22:03 +08:00
Rui Ueyama
0e1226287b Remove a dead variable 2022-06-27 14:57:49 +08:00
Rui Ueyama
685085f6fe Refactor 2022-06-27 12:50:10 +08:00
Rui Ueyama
582350cc81 Simplify 2022-06-27 12:29:20 +08:00
Rui Ueyama
335698851b [Mach-O] Add -reexport-l 2022-06-26 18:27:36 +08:00
Rui Ueyama
7b5b1a340b [Mach-O] Handle weak dynamic symbols 2022-06-26 17:21:26 +08:00
Rui Ueyama
3e6f6fe8b5
Merge pull request #557 from wangp/grep-P
Don't use grep -P in tests
2022-06-26 16:42:20 +08:00
Rui Ueyama
c001b75d90 Attempt to fix CI 2022-06-26 16:41:30 +08:00
Rui Ueyama
48b782ac6d Ensure that we build TBB with RelWithDebInfo release type
Fixes https://github.com/rui314/mold/issues/558
2022-06-26 16:23:35 +08:00
Rui Ueyama
0be1318b7e Attempt to fix CI 2022-06-26 16:15:06 +08:00
Rui Ueyama
1524746a80 [Mach-O] Fix weak undef symbols 2022-06-26 15:57:15 +08:00
Peter Wang
2963ab672c Don't use grep -P in tests
The version of grep being used may not support the -P flag
(Perl-compatible regular expressions).
2022-06-26 15:51:25 +10:00
Rui Ueyama
fe72463f55 [Mach-O] Set mold's version to LC_BUILD_VERSION
I chose 0x6d6f6c64 as a magic number without coordinating with other
tools or Apple, but it should be fine.
2022-06-26 13:14:07 +08:00
Rui Ueyama
831f872886 [Mach-O] Do not emit corrupted unwind table 2022-06-25 19:22:38 +08:00
Rui Ueyama
d9a28221dd [Mach-O] Sort the symtab and fill LC_DYSYMTAB fields 2022-06-24 16:00:50 +08:00
Rui Ueyama
62be1fcdb0 Simplify 2022-06-24 11:41:18 +08:00
Rui Ueyama
a7b8da9345 Simplify 2022-06-24 10:44:35 +08:00
Rui Ueyama
9e2e70ce7d
Merge pull request #540 from rbartlensky/allow-shlib-undefined
Implement `--(no-)allow-shlib-undefined.
2022-06-24 10:19:07 +08:00
Robert Bartlensky
21a2d6bb6c
Implement `--(no-)allow-shlib-undefined.
This also fixes the `note-property` test which was hanging on my
machine. Turns out `$CC` was stuck waiting to read from `stdin`,
and as such I decided to write something into it.

Signed-off-by: Robert Bartlensky <bartlensky.robert@gmail.com>
2022-06-23 23:46:15 +01:00
Rui Ueyama
9a3188bcf5 [Mach-O] Compute LC_UUID using the entire code signature section
We used to compute a file UUID using only the hashes in the code
signature section. So we computes the same UUID even if two files
are differnet only in some field of the code signature section.
2022-06-22 20:29:03 +08:00
Rui Ueyama
9cd811393f Simplify 2022-06-22 14:14:08 +08:00
Rui Ueyama
8b86c49f42 [Mach-O] Make sure -thread_count works properly 2022-06-22 14:14:08 +08:00
Rui Ueyama
52943009b7 [ELF] Handle R_ARM_MOVT_PREL and R_ARM_PREL31 as non-address-taking relocations
This is an attempt to fix https://github.com/rui314/mold/issues/545 though
I don't know if this is a correct fix.
2022-06-19 11:32:08 +08:00
Rui Ueyama
00c16556de Revert "[Mach-O] Do not fill text segment with 0x90"
This reverts commit b8f6fe1a1a as an
attempt to fix CI.
2022-06-18 19:38:12 +08:00
Rui Ueyama
b8f6fe1a1a [Mach-O] Do not fill text segment with 0x90
0x90 is a NOP on x86-64 but doesn't make sense on ARM.
2022-06-18 19:21:35 +08:00
Rui Ueyama
a9f063a394 [Mach-O] Parallelize claim_unresolved_symbols() 2022-06-18 19:16:28 +08:00