1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-13 09:39:13 +03:00
Commit Graph

2852 Commits

Author SHA1 Message Date
Rui Ueyama
8639fc8a9b [Mach-O] wip 2021-10-12 18:33:41 +09:00
Rui Ueyama
031de0df32 [Mach-O] wip 2021-10-12 18:33:41 +09:00
Rui Ueyama
43f2e46f34 [Mach-O] wip 2021-10-12 18:33:41 +09:00
Rui Ueyama
bb67c78df8 [Mach-O] wip 2021-10-12 18:33:41 +09:00
Rui Ueyama
a0a162a48c [Mach-O] wip 2021-10-12 18:33:41 +09:00
Rui Ueyama
d176ed8fbb [Mach-O] wip 2021-10-12 18:33:41 +09:00
Rui Ueyama
96b07d875d [Mach-O] wip 2021-10-12 18:33:41 +09:00
Rui Ueyama
c1c8270e45 [Mach-O] wip 2021-10-12 18:33:41 +09:00
Rui Ueyama
e6c614d69c [ELF] Remove extra path separators 2021-10-12 18:32:20 +09:00
Rui Ueyama
ffb8e03c97 [ELF] Make .rela.dyn and .rela.plt contiguous in an output file
glibc 2.22 or prior have a bug that the dynamic linker (ld-linux.so.2)
crashes on `dlopen` if .rela.dyn and .rela.plt are not contiguous in
the `dlopen`-ed file and RTLD_NOW is specified. That bug was fixed in
fa19d5c48a.

glibc 2.23 which includes the fix for the bug was released on 2016-02-18.
So, unless you are using glibc that is more than 5 years old, mold-
generated shared object files work fine with `dlopen`. But it is easy
to make the sections contiguous in file, so I'll commit this change as a
workaround for the bug.

Fixes https://github.com/rui314/mold/issues/120
2021-10-12 17:10:32 +09:00
Rui Ueyama
06c237838c [ELF] Fix --help message
Fixes https://github.com/rui314/mold/issues/119
2021-10-08 23:43:03 +09:00
Rui Ueyama
e942f5e28e Fix build failure 2021-10-08 20:38:30 +09:00
Rui Ueyama
038f42a579 [Mach-O] wip 2021-10-08 20:24:39 +09:00
Rui Ueyama
69ce692671 [Mach-O] wip 2021-10-08 18:39:48 +09:00
Rui Ueyama
d76c6966b0 [Mach-O] wip 2021-10-08 16:55:33 +09:00
Rui Ueyama
f7d3fda88a [Mach-O] wip 2021-10-08 16:52:42 +09:00
Rui Ueyama
45fdfd4e87 Disable C++ exceptions
mold itself doesn't use C++ exceptions, so we can disable C++ exceptions.
Passing `-fno-exceptions` to g++/clang++ makes them to produce smaller code.
2021-10-08 15:04:16 +09:00
Rui Ueyama
8ecb117997 [Mach-O] wip 2021-10-07 22:05:49 +09:00
Rui Ueyama
0b5b5dbcf5 [Mach-O] wip 2021-10-07 20:27:53 +09:00
Rui Ueyama
071c74acb3 [Mach-O] wip 2021-10-07 20:01:46 +09:00
Rui Ueyama
86c8b77dd6 [Mach-O] wip 2021-10-07 19:17:18 +09:00
Rui Ueyama
91ec5ae972 [Mach-O] wip 2021-10-07 18:12:38 +09:00
Rui Ueyama
14cadf44ac [Mach-O] wip 2021-10-07 18:01:00 +09:00
Rui Ueyama
a414c03bf3 [Mach-O] wip 2021-10-07 17:52:17 +09:00
Rui Ueyama
a8b2f521f7 [ELF] Create .rodata.cst and .rodata.str sections
Previously, mold created two or more ".rodata" sections if input files
contain regular .rodata sections as well as .rodata.str* or .rodata.cst*
sections. This is because .rodata.str* and .rodata.cst* contains mergeable
section contents (i.e. string constants and constant pools, respectively),
and they are handled in a special way.

In ELF, section names are not significant, so nothing is wrong with
creating multiple .rodata. However, valgrind unfortunately doesn't like
such executable.

With this change, mold keeps ".rodata.str" and ".rodata.cst" prefixes
to avoid creating multiple ".rodata" sections.

Fixes https://github.com/rui314/mold/issues/118
2021-10-07 13:55:46 +09:00
Rui Ueyama
d71c33b3e8 [ELF] Refactor 2021-10-07 12:40:55 +09:00
Rui Ueyama
301d45b2fa Fix a test 2021-10-06 22:04:25 +09:00
Rui Ueyama
f49265c788 [Mach-O] Take stub address into symbol address computation 2021-10-06 20:29:08 +09:00
Rui Ueyama
510ec4b003 [Mach-O] Copy __cstring section from input to output 2021-10-06 17:24:51 +09:00
Rui Ueyama
45788bd8ad [Mach-O] wip 2021-10-06 17:16:02 +09:00
Rui Ueyama
e2d7cd7b03 [Mach-O] wip 2021-10-06 16:53:20 +09:00
Rui Ueyama
627fbc3ec0 [Mach-O] wip 2021-10-06 16:41:18 +09:00
Rui Ueyama
3c513a31cc [Mach-O] Apply relocations 2021-10-06 14:33:01 +09:00
Rui Ueyama
7fc365a657 [Mach-O] wip 2021-10-06 13:43:41 +09:00
Rui Ueyama
dc9cfc4f41 [Mach-O] wip 2021-10-05 22:17:14 +09:00
Rui Ueyama
e36cf0271f [Mach-O] wip 2021-10-05 20:14:28 +09:00
Rui Ueyama
46c20da35e [Mach-O] wip 2021-10-05 20:02:41 +09:00
Rui Ueyama
27e52a430b [Mach-O] wip 2021-10-05 19:39:39 +09:00
Rui Ueyama
46d3e12946 [Mach-O] wip 2021-10-05 19:26:15 +09:00
Rui Ueyama
a861f192ec [Mach-O] wip 2021-10-05 19:17:57 +09:00
Rui Ueyama
bd259a795f [Mach-O] wip 2021-10-05 16:00:45 +09:00
Rui Ueyama
2da5057d58 [Mach-O] wip 2021-10-05 12:59:22 +09:00
Rui Ueyama
d111361a1f [Mach-O] wip 2021-10-05 12:59:18 +09:00
Rui Ueyama
46868805e2 [Mach-O] wip 2021-10-05 11:40:33 +09:00
Rui Ueyama
e1e603f633 [Mach-O] wip 2021-10-05 11:40:33 +09:00
Rui Ueyama
0a130212cb [Mach-O] wip 2021-10-05 11:40:33 +09:00
Rui Ueyama
7dd9a38b3b [Mach-O] wip 2021-10-05 11:40:32 +09:00
Rui Ueyama
e7f3e94f30 [Mach-O] wip 2021-10-05 11:40:32 +09:00
Rui Ueyama
2dc8ac0bdd [Mach-O] wip 2021-10-05 11:40:32 +09:00
Rui Ueyama
4932daadba [Mach-O] wip 2021-10-05 11:40:32 +09:00