mailing list of musl libc
 help / color / mirror / code / Atom feed
* [BUG] Force to use a dynamic linker in musl-clang wapper cause a crash for static-pie c++ programs.
@ 2019-12-24 14:38 Youren Shen
  2019-12-24 15:03 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Youren Shen @ 2019-12-24 14:38 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

Hey, there,
Recently I'm trying to build a non-gnu toolchain with musl, clang, llvm,
libc++, compiler-rt. While static-pie feature is very useful in our
project, musl-clang force to link a dynamic linker into the binary. This
behavior will cause a crash in c++ programs with compiler-rt and libc++.
For more details and reproduction of this bug, you can read my previous
email to llvm-dev mail lists.[1]
I spend a few days to find the reason -- in function _dlstart_c, the
program will get a "base" of relocation in /lib/ld-musl-x86_64.so.1, which
is not right when it tries to relocate .rel.dyn section in the binary.
Overall, the static-pie program does not need a dynamic linker at all. So
maybe we should remove this argument in wrapper when static-pie is enabled.

Thank you very much.

[1]. https://groups.google.com/forum/#!msg/llvm-dev/XPrSPqD2zjM/YtH6Fi2YAgAJ
-- 
Best Regards.
Youren Shen.

[-- Attachment #2: Type: text/html, Size: 1213 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-26  4:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-24 14:38 [BUG] Force to use a dynamic linker in musl-clang wapper cause a crash for static-pie c++ programs Youren Shen
2019-12-24 15:03 ` Rich Felker
2019-12-25 10:37   ` Youren Shen
2019-12-26  4:46     ` Fangrui Song

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).