1
1
mirror of https://github.com/rui314/mold.git synced 2024-10-05 09:07:10 +03:00
Commit Graph

68 Commits

Author SHA1 Message Date
Rui Ueyama
778f8629eb Refactor 2022-01-09 12:34:32 +09:00
Rui Ueyama
e29bd8f42b [ELF] Add -z shstk
Fixes https://github.com/rui314/mold/issues/229
2022-01-09 12:34:24 +09:00
Rui Ueyama
fbfa01dcd1 [ELF] Implement -z ibtplt
https://github.com/rui314/mold/issues/229
2022-01-08 14:09:12 +09:00
Rui Ueyama
18367e69a8 Refactor 2022-01-08 13:24:29 +09:00
Rui Ueyama
644fdc8a2f Simplify 2022-01-07 20:42:25 +09:00
Rui Ueyama
0e17dbeda8 [ELF] Make --defsym'ed symbols absolute
If a symbol is defined in the form of --defsym=foo=0x<hexvalue>,
it should be defined as an absolute symbol with the given value.
2022-01-07 16:28:14 +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
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
be49d673a5 [ELF] Deduce emulation from input files if -m is not given 2022-01-05 19:55:32 +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
a2839f60dd [ELF] Improve an error message
Fixes https://github.com/rui314/mold/issues/233
2022-01-04 13:49:48 +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
d100a735a0 Refactor: rename a function 2021-12-31 21:28:16 +09:00
Rui Ueyama
902f23c456 Refactor 2021-12-31 21:04:07 +09:00
Rui Ueyama
c92e192e56 [ELF] Remove redundant inline keywords 2021-12-31 21:02:06 +09:00
Rui Ueyama
440ff27e58 [ELF] Refactor 2021-12-31 21:01:59 +09:00
Rui Ueyama
085e3c3abe Simplify 2021-12-31 18:04:39 +09:00
Rui Ueyama
58e43633fc Revert "Revert "Use C++17 filesystem API""
This reverts commit f29a85f20a with a fix
for a build failure.
2021-12-31 16:39:54 +09:00
Rui Ueyama
f29a85f20a Revert "Use C++17 filesystem API"
This reverts commit f6e91df440 because
it causes build breakages for a lot of Gentoo packages.
2021-12-30 22:15:52 +09:00
Rui Ueyama
f6e91df440 Use C++17 filesystem API 2021-12-30 21:32:01 +09:00
Rui Ueyama
d49c50ddaf [ELF] Add --defsym
Fixes https://github.com/rui314/mold/issues/208
2021-12-30 14:48:39 +09:00
Rui Ueyama
f3766cda81 [ELF] Add -z {max,common}-page-size
Fixes https://github.com/rui314/mold/issues/203
2021-12-29 17:14:08 +09:00
Rui Ueyama
6e290aab3e [ELF] Implement --color-diagnostics 2021-12-25 16:55:51 +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
8c86c28496 Add -z nodefaultlib
Fixes https://github.com/rui314/mold/issues/184
2021-12-23 15:01:57 +09:00
Rui Ueyama
530568e662 [ELF] Use a better type 2021-12-20 20:08:25 +09:00
Rui Ueyama
455e729393 [ELF] Make version script application faster
Instead of calling regex match multiple times, create a single
regex and call regex match function only once.

https://github.com/rui314/mold/issues/156
2021-12-17 19:09:26 +09:00
Rui Ueyama
04d5abc9eb Attempt to fix an ODR violation 2021-12-16 20:34:13 +09:00
Rui Ueyama
733bb6354f Rename variables 2021-12-11 21:40:57 +09:00
Rui Ueyama
54d75153d2 Rename variables 2021-12-07 21:55:04 +09:00
Rui Ueyama
84cd674ff1 Revert "[ELF] Rename section piece -> subsection"
This reverts commit 3fc9c6c3ed.
2021-12-07 14:44:32 +09:00
Rui Ueyama
58b74bf961 Revert "[ELF] s/SectionFragment/Subsection/g"
This reverts commit aa46df7735.
2021-12-07 14:44:11 +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
986516545a [ELF] Do not share OutputFile between ELF and Mach-O 2021-10-26 14:06:11 +09:00
Rui Ueyama
ca9a6d0843 Move code from elf/output-file.cc to output-file.h 2021-10-05 11:37:30 +09:00
Rui Ueyama
30b45d2263 [ELF] Rename Symbol<E>::intern -> intern 2021-10-05 08:31:28 +09:00
Rui Ueyama
3fc9c6c3ed [ELF] Rename section piece -> subsection 2021-10-05 08:22:38 +09:00
Rui Ueyama
77069156cb [ELF] Rename OutputChunk Chunk 2021-10-04 10:16:24 +09:00
Rui Ueyama
928c39937a Refactor 2021-10-03 16:26:31 +09:00
Rui Ueyama
001cf042d9 Refactor 2021-10-03 16:01:59 +09:00
Rui Ueyama
fcd10254b7 Rename variables 2021-10-03 16:01:59 +09:00
Rui Ueyama
ebc8a68cb3 [ELF] Rename variables 2021-10-02 14:12:42 +09:00
Rui Ueyama
52c7793326 Move archive-file.cc out of elf directory 2021-09-30 23:13:27 +09:00
Rui Ueyama
7c9205f68d Move memory-mapped-file.cc out of elf directory
So that we can use the class from mold/mach-o.
2021-09-30 23:13:22 +09:00
Rui Ueyama
a2c9d0ad4d [ELF] Reduce the size of Subsection struct 2021-09-29 16:30:04 +09:00
Rui Ueyama
aa46df7735 [ELF] s/SectionFragment/Subsection/g 2021-09-29 16:18:41 +09:00
Rui Ueyama
2844f1f573 [ELF] Refactor 2021-09-28 13:23:58 +09:00
Rui Ueyama
bc2bd0e26a [ELF] Refactor 2021-09-27 23:01:51 +09:00