From: BwackNinja <bwa...@gm...> - 2016-12-12 04:41:56
|
Hi, I've been watching the project, and trying out elftoolchain's linker, though I'm running it on Linux. It looks like it mostly works. I've gotten it to link a working musl libc. That involved changing it to link as a dynamic executable despite not linking to any shared libraries, as well as some small fixes. The one thing I'm unsure about here is the change I made to ld_reloc.c. It makes a working musl libc, but I got to that point by looking at the symbols musl was segfaulting on when loading itself and the output differences in readelf between musl linked with binutils and elftoolchain. I've also gotten it to link a working llvm/clang/lld/libc++/libc++abi/libunwind as well. That was mostly dealing with some peculiarities of musl (empty libm.a, etc), falling back to parsing a file as a linker script when the it isn't detected as a library (for linking with libc++, because libc++.so is a linker script), and dealing with archive files being referenced multiple times on the command line, resulting in duplicate symbols. I also had to disable llvm's version scripts passed to the linker when compiling it, which were causing ld to segfault. I haven't looked into that much yet. Patches attached. ~ BwackNinja |