https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66219
--- Comment #2 from Cao Da Shi <dscao999 at hotmail dot com> --- This issue poped up when cross compiling systemd-219. It is confirmed that the missed section has the __attribute__((used)) declared. But still the link will only pass without "-flto", with all other options exactly the same. The files are too large to be sent. The link command is as follows: arm-elf-linux-gnueabi-gcc -shared -Wl,-Map=/tmp/mymap.txt -fPIC -DPIC pam_systemd_la-pam_systemd.o -Wl,--whole-archive libsystemd-internal.a libsystemd-shared.a -Wl,--no-whole-archive -Wl,-rpath -lrt -lcap -lm libpam_misc.so libpam.so -ldl -flto -O2 -Wl,--as-needed -Wl,--no-undefined -Wl,--gc-sections -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--version-script=pam_systemd.sym -pthread -Wl,-soname -Wl,pam_systemd.so -o /tmp/pam_systemd.so $ arm-elf-linux-gnueabi-gcc -v Using built-in specs. COLLECT_GCC=arm-elf-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/opt/cxpkg/cxarm/libexec/gcc/arm-elf-linux-gnueabi/4.8.4/lto-wrapper Target: arm-elf-linux-gnueabi Configured with: /home/dscao/build/native/gcc/gcc-4.8.4/configure --prefix=/opt/cxpkg/cxarm --target=arm-elf-linux-gnueabi --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --with-tune=cortex-a8 --with-arch=armv7-a -with-mode=arm --with-float=hard --with-fpu=vfp3 --disable-nls --with-system-zlib --with-sysroot=/var/opt/cxroots/armroot --enable-languages=c,c++ --enable-checking=release --enable-threads=posix --enable-shared Thread model: posix gcc version 4.8.4 (GCC)