Rui Ueyama
3102ab867c
Refactor
2021-06-11 02:12:19 +09:00
Rui Ueyama
882036a729
Update README
2021-06-10 15:50:44 +09:00
Rui Ueyama
cce738c9d5
Add mimalloc as a git submodule
...
This change adds mimalloc as a git submodule so that `make` doesn't
try to clone mimalloc repo. This change should allow building mold
with the nix package manager, which doesn't provide network access
while building.
This change may conflict with a local `mimalloc` directory. If you
already have checked out mold and `mimalloc` directory exists in the
mold directory, you may need to remove it by `rm -r mimalloc` before
running `make`.
Requested by David Yamnitsky.
Fixes https://github.com/rui314/mold/issues/50
2021-06-10 13:20:43 +09:00
Rui Ueyama
bb050128b3
Allow R_NONE in .rel.eh_frame
2021-06-08 23:36:19 +09:00
Rui Ueyama
c53a71ada3
Simplify
2021-06-08 13:42:40 +09:00
Rui Ueyama
8c75327817
Simplify
...
AFAIK, GOT entry size is always the same as the machine word size,
so remove E::got_size and use E::wordsize instead.
2021-06-08 00:01:55 +09:00
Rui Ueyama
9fc6050f41
Simplify
2021-06-07 23:36:05 +09:00
Rui Ueyama
98dbddaa77
Ignore .gnu.warning.* sections
2021-06-07 22:35:32 +09:00
Rui Ueyama
3324acafc5
Rename --icf to --icf=all for compatibility with lld and gold
2021-06-07 21:55:08 +09:00
Rui Ueyama
8bf21f9ea0
Report an error for unknown -z flags
2021-06-07 20:53:35 +09:00
Rui Ueyama
6d13fe2e7f
Add -z muldefs
as an alias to --allow-multiple-definition
2021-06-07 20:48:06 +09:00
Rui Ueyama
b9e1bd8117
Document --allow-multiple-definition option
2021-06-07 20:44:56 +09:00
Rui Ueyama
3f693a3d31
Remove unused #include
2021-06-07 19:44:10 +09:00
Rui Ueyama
8833dcbcb0
Fix relocations for i386 PIC
2021-06-07 18:37:50 +09:00
Rui Ueyama
a0c3fcb1bb
Do not put local symbols to .dynsym
2021-06-06 17:24:49 +09:00
Rui Ueyama
fc54693be5
Fix zlib-gnu-style compressed section decoding
2021-06-05 20:51:21 +09:00
Rui Ueyama
214bcb2f48
Make it compile with GCC-11
...
Fixes https://github.com/rui314/mold/issues/37
2021-06-05 19:54:30 +09:00
Rui Ueyama
89ccfa1a00
Always compute 64-bit hash values for build reproducibility
2021-06-05 19:13:56 +09:00
Rui Ueyama
69a9898e80
Fix style
2021-06-05 19:02:53 +09:00
Rui Ueyama
5ec806aa31
Merge pull request #43 from 3a2l/FixICFAssert
...
Move call SHA256_Final outside of assert
2021-06-05 10:15:51 +09:00
Ahmed
6829d465ea
Move call to SHA256_Final outside of assert.
...
Signed-off-by: Ahmed Hesham <ahesham@outlook.com>
2021-06-04 19:40:18 +01:00
Rui Ueyama
7f7507af0a
Merge pull request #38 from gjimye/fix/string-constructor-type-error
...
Fix string ctor param from strstr
2021-06-05 01:58:43 +09:00
Jim Ye
9c304f74d3
Fix string ctor param from strstr
...
When using the (begin, end) constructor for string, the types of begin
and end must match, including cv qualifiers. Depending on the library
headers used, strstr(const char *, const char *) can potentially return
char * or const char *, the former being a call to the C function strstr
and the latter being a call to C++ std::strstr.
This commit fixes the clang portion of issue #21 , by explicitly casting
the return value of strstr to match the 1st param of the string ctor so
that the ctor can be instantiated regardless of the header used.
Signed-off-by: Jim Ye <gjimye@gmail.com>
2021-06-05 02:01:18 +10:00
Rui Ueyama
889593c66f
Add CONTRIBUTING.md
2021-06-05 00:34:52 +09:00
Rui Ueyama
ee3b0293fd
Rename an envvar
2021-06-04 20:32:58 +09:00
Rui Ueyama
6e7baef8d3
Set DT_RELACOUNT field
2021-06-04 20:04:30 +09:00
Rui Ueyama
e076414f91
Do not unnecessarily page-align some segments
2021-06-04 15:33:01 +09:00
Rui Ueyama
507ee38975
Set ELF header's p_paddr
...
On Unix, p_paddr values (segment physical addresss) don't matter,
but GNU linkers set them to the same value as p_vaddr. We should
set the same values for compatibility with programs that make the
wrong assumption.
2021-06-04 15:32:21 +09:00
Rui Ueyama
b0b2406d84
Set the entry address to .text if entry point symbol is not defined
2021-06-04 15:30:32 +09:00
Rui Ueyama
b5c68b465e
Revert "Change the default build-id size from 20 to 16 bytes"
...
This reverts commit fe76210da6
because I misunderstood the actual default size of build-id
of the GNU linkers.
2021-06-04 12:32:28 +09:00
Rui Ueyama
d3923b9f27
Weak symbols shouldn't keep as-needed DSOs
...
If all references to an DSO are weak, the DSO shouldn't be considered
being used in terms of --as-needed. This is needed for GNU ld compatibility.
2021-06-04 12:24:25 +09:00
Rui Ueyama
3fb870c80b
Add --compress-debug-info=zlib-gnu
2021-06-03 23:57:06 +09:00
Rui Ueyama
fe76210da6
Change the default build-id size from 20 to 16 bytes
...
GNU ld's default build-id size is 16.
2021-06-03 22:14:55 +09:00
Rui Ueyama
3bfefefb2d
Kill build commands that ignore SIGTERM with SIGKILL
2021-06-02 20:23:52 +09:00
Rui Ueyama
257ae1a98b
Avoid unnecessary string allocations
2021-06-01 15:19:50 +09:00
Rui Ueyama
f9e91aa391
Do not embed a library fullpath if it is given by -l
2021-06-01 15:15:25 +09:00
Rui Ueyama
1f3931fc9e
Do not put non-alloc NOTE section into a PT_LOAD segment
...
This bug caused a test failure of Gentoo's dev-lang/go-1.16.4
paackage. Specifically, `go tool dist test testshared` failed
due to this bug.
2021-06-01 00:53:06 +09:00
Rui Ueyama
8219fdd688
Simplify input file priority
...
This change is required to build Gentoo's net-libs/libtorrent-0.13.8-r1
package with FEATURES=test, e.g.
$ FEATURES=test emerge net-libs/libtorrent
2021-05-31 17:09:40 +09:00
Rui Ueyama
2a61e5af51
Format
2021-05-31 12:48:52 +09:00
Rui Ueyama
8940abf807
Sort .{init,fini}_array and .[cd]tors
2021-05-31 01:11:45 +09:00
Rui Ueyama
02fa969295
Place .ctors and .dtors into .init_array and .fini_array
...
This change is needed to build Gentoo's dev-lang/gprolog-1.4.5,
which is the GNU Forth package. GNU Forth creates ELF objects
itself, and it still uses .ctors and .dtors as opposed to .init_array
and .fini_array.
2021-05-30 22:05:07 +09:00
Rui Ueyama
ed98211a24
Allow to refer unversioned symbol within an object file
...
Previously, mold couldn't handle an object file which contains
versioned symbol `foo@@SOME_VERSION` that also has an undefined
symbol `foo`. Now, `foo` is resolved to `foo@@SOME_VERSION`.
This change is required to build Gentoo's media-libs/alsa-lib-1.2.3.2-r1
package.
2021-05-30 18:03:21 +09:00
Rui Ueyama
aeecf2cba6
Ignore symbol versions when creating executables
...
This is needed for Gentoo's dev-libs/libaio-0.3.112 package.
2021-05-30 13:33:05 +09:00
Rui Ueyama
a2017e5d3a
Skip incompatible library files
...
This change is required to build Gentoo's net-libs/libtorrent-0.13.8-r1
package.
2021-05-29 20:47:16 +09:00
Rui Ueyama
60fee59742
Ignore --no-undefined-version
...
Gentoo's sys-boot/efibootmgr package uses this flag.
2021-05-29 17:07:54 +09:00
Rui Ueyama
3cfbc0d66c
Parallelize tests
2021-05-29 16:05:38 +09:00
Rui Ueyama
c805f7c087
Fix broken tests
2021-05-29 14:20:56 +09:00
Rui Ueyama
fbed89948c
Add -R as an alias for -rpath
...
This change is required to build Gentoo dev-erlang/stringprep package.
2021-05-29 13:42:10 +09:00
Rui Ueyama
6b10fbd834
Add end, etext and edata symbols
2021-05-29 02:07:46 +09:00
Rui Ueyama
8fe15c8dc8
Make linker-synthesized symbols to overwrite other symbols
2021-05-29 00:31:40 +09:00