https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88262
Stephen Kim <stephen.kim at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stephen.kim at oracle dot com --- Comment #4 from Stephen Kim <stephen.kim at oracle dot com> --- (In reply to jos...@codesourcery.com from comment #3) > As of October 2017, glibc has a testcase that having main in a shared > library works - that's a valid use case, which should work with crt1.o. > If it doesn't work for some particular architecture that would be a glibc > bug (or conceivably an ld bug) - but I'd also expect it to show up as a > failure of the glibc elf/tst-main1 test, and no such failure is listed for > any architecture on <https://sourceware.org/glibc/wiki/Release/2.28>. The glibc commit that triggered this bug is: bfff8b1becd7d01c074177df7196ab327cd8c844 It is a patch for aarch64 only. From there, giving crt1.o rather than Scrt1.o has become problematic. The patch is included in Oracle Linux while it is not in Debian. The patch was made this year. Thus, back then 2017, I think this problem did not exist. Unfortunately, glibc still keeps the patch. Thus, the bug might be going to be a problem in case of other Linux distro running on arm64, I believe. Gentoo has the same issue but it avoids by defaulting PIE: --enable-default-pie at configure.