Rui Ueyama
7b3c640472
Fix --dynamic-list
...
Previously, symbols were not exported from an executable even if
they are specified so by a dynamic list.
2021-12-25 13:38:24 +09:00
Rui Ueyama
04ccd4dbdd
[ELF] Export undef symbols if both -z defs
and -warn-undefined-symbols
are given
...
When we are creating a DSO, unresolved undefined symbols are promoted to
dynamic symbols by default so that they will get another chance to be
resolved at runtime.
You can suppress this behavior by passing `-z defs`. If that option is
given, remaining undefs are reported as errors instead of being silently
promoted.
It looks like `-warn-undefined-symbols` negates the effect of `-z defs`.
So, if both options are given, remaining undefs are promoted to dynamic
symbols. mold previously silently make such symbols absolute symbols with
value 0.
Fixed https://github.com/rui314/mold/issues/152
2021-12-24 21:13:15 +09:00
Rui Ueyama
5601cf4236
[ELF] Add -z separate-code
, -z noseparate-code
and -z separate-lodable-segments
...
Fixes https://github.com/rui314/mold/issues/172
2021-12-24 20:28:45 +09:00
Rui Ueyama
088912e2fc
[ELF] Create less number of PT_NOTE segments
2021-12-24 20:15:56 +09:00
Rui Ueyama
29d956a7b0
[ELF] Fix handling of DSO symbols with default version
...
Fixes https://github.com/rui314/mold/issues/150
2021-12-24 16:10:01 +09:00
Rui Ueyama
1ba6cc9188
[ELF] Handle relocation referring 0th symbol correctly
2021-12-24 16:09:57 +09:00
Rui Ueyama
135f17c5aa
[ELF] Handle --sysroot
...
Attempt to fix https://github.com/rui314/mold/issues/150
2021-12-23 21:23:00 +09:00
Rui Ueyama
8c86c28496
Add -z nodefaultlib
...
Fixes https://github.com/rui314/mold/issues/184
2021-12-23 15:01:57 +09:00
Rui Ueyama
76407a6646
Do not create a PT_NOTE segment for non-alloc .note sections
...
Fixes https://github.com/rui314/mold/issues/185
2021-12-23 14:04:08 +09:00
Rui Ueyama
4d5e4730a2
Fix typo
2021-12-22 20:44:29 +09:00
Rui Ueyama
24bf92c27c
[ELF] Fix a crash bug
2021-12-22 20:41:11 +09:00
Rui Ueyama
8bc57363c8
[ELF] Issue a warning instead of error for an unknown -z option
...
Fixes https://github.com/rui314/mold/issues/180
2021-12-22 20:08:14 +09:00
Rui Ueyama
74fdf90d70
Fix a test for clang and clang-as
...
clang-as does not support --keep-locals, so use its synonym -L
which is supported both by GNU as and clang-as.
Fixes https://github.com/rui314/mold/issues/173
2021-12-22 11:42:29 +09:00
Rui Ueyama
f9ff04866e
[ELF] Add --threads=N option
...
Fixes https://github.com/rui314/mold/issues/168
2021-12-20 16:29:22 +09:00
Rui Ueyama
1d6d0e2fe3
Merge pull request #158 from sylvestre/second-fix
...
test/pie.sh: extend the check to other output
2021-12-17 20:16:07 +09:00
Rui Ueyama
4f37c3d024
Fix tests in non-English environment
...
These test files are not only invoked by make by also directly by hand.
Unsetting `LANG` on each file so that they don't fail in a non-English
environment.
This change is mechanically created by the following command:
sed -i '1 a export LANG=' test/*/*.sh
2021-12-17 20:06:50 +09:00
Sylvestre Ledru
fbee0ec588
test/pie.sh: extend the check to other output
...
On debian unstable, the output doesn't contain 'Shared object file'
Parsing a different output
Signed-off-by: Sylvestre Ledru <sylvestre@debian.org>
2021-12-17 10:02:21 +01:00
Rui Ueyama
36633895e5
[ELF] Fix undefined symbol versions
...
Previously, if the following conditions are met:
- we are creating a shared object file,
- there's an undefined symbol in an input object file that are
to be promoted to a dynamic symbol, and
- a version script defining a default version is given,
then the symbol gets the default version. But that's a wrong behavior
because version scripts should not affect symbols that are not defined
in an output file.
This change fixes the issue by not setting version to such symbol.
Fixes https://github.com/rui314/mold/issues/151
2021-12-17 17:07:36 +09:00
Rui Ueyama
27f72ac320
Fix tests
2021-12-15 20:42:27 +09:00
Rui Ueyama
c9a2fd1d7d
Fix a test
2021-12-15 10:36:51 +09:00
Rui Ueyama
10a318d5ba
[ELF] Fix -exclude_libs option
2021-12-10 20:45:57 +09:00
Rui Ueyama
22116629f1
[ELF] Add --start-lib and --end-lib
...
Fixes https://github.com/rui314/mold/issues/133
2021-12-06 20:09:46 +09:00
Rui Ueyama
0328f37b2a
[Mach-O] Add -bundle
2021-12-05 16:52:35 +09:00
Rui Ueyama
c5f5e6153f
[Mach-O] Add -headerpad_max_install_names
2021-12-05 15:53:41 +09:00
Rui Ueyama
6fae1d8555
[Mach-O] Report an error on -search_dylibs_first
2021-12-05 15:40:36 +09:00
Rui Ueyama
a3e0e9f197
wip
2021-12-04 16:41:51 +09:00
Rui Ueyama
6a3ddf1ab4
wip
2021-12-04 16:31:15 +09:00
Rui Ueyama
a415accbc3
wip
2021-12-04 12:55:21 +09:00
Rui Ueyama
d6a9005b14
wip
2021-12-04 12:10:18 +09:00
Rui Ueyama
bf7366438b
wip
2021-12-03 23:06:07 +09:00
Rui Ueyama
4bd92c0d46
[Mach-O] Do not emit PAGEZERO segment for dylibs
2021-12-01 15:14:38 +09:00
Rui Ueyama
8ceaf53728
[Mach-O] Add -needed_framework
2021-12-01 13:45:25 +09:00
Rui Ueyama
ee05f3a65f
[Mach-O] Add -dead_strip_dylibs
2021-11-30 19:20:29 +09:00
Rui Ueyama
7156dd265f
[Mach-O] Add -needed-l
2021-11-30 18:05:28 +09:00
Rui Ueyama
9e7e41cfac
[Mach-O] Fix -L
2021-11-30 15:23:00 +09:00
Rui Ueyama
4998a130e5
[Mach-O] Support -dylib
2021-11-29 18:12:48 +09:00
Rui Ueyama
e99727f87f
[Mach-O] Add -Z
2021-11-28 10:05:23 +09:00
Rui Ueyama
1219d3250c
[ELF] Fix a test for AArch64
2021-11-27 21:03:47 +09:00
Rui Ueyama
8ae43210e7
[Mach-O] Add -framework and -F
2021-11-27 20:03:12 +09:00
Rui Ueyama
72cea9a0bf
[Mach-O] Improve -filelist
2021-11-21 22:18:55 +09:00
Rui Ueyama
5804d6b4b2
[Mach-O] Add -ObjC
2021-11-21 20:26:41 +09:00
Rui Ueyama
efb6e6729a
[Mach-O] Handle response files correctly
2021-11-21 14:53:50 +09:00
Rui Ueyama
6087782660
[Mach-O] Add -filepath
2021-11-20 19:26:29 +09:00
Rui Ueyama
cee6412e3d
[Mach-O] Add -rpath
2021-11-20 19:01:18 +09:00
Rui Ueyama
39676ef7a9
Define BINDIR, LIBDIR and MANDIR
...
So that it is easy to specify alternative install target paths.
2021-11-19 17:18:15 +09:00
Rui Ueyama
8b41bb923a
[ELF] Fix canonical PLT entry
...
Previously, an executable linked by mold could fall into an infinite
loop between .plt.got and .got entries. This commit fixes the issue
by creating .plt entries instead of .plt.got.
Fixes https://github.com/rui314/mold/issues/129
2021-11-18 20:53:15 +09:00
Rui Ueyama
18cfe1f4ca
[Mach-O] Add -pagezero_size option
2021-11-14 14:23:44 +09:00
Rui Ueyama
06bc828a9b
[Mach-O] wip
2021-11-14 13:30:55 +09:00
Rui Ueyama
433666a470
[Mach-O] Implement -dead_strip
2021-11-13 15:21:52 +09:00
Rui Ueyama
fcd592e53d
[Mach-O] Add -e option
2021-11-12 19:10:00 +09:00