Linker error

Skip to first unread message


Nov 29, 2021, 2:46:04 PM11/29/21
to android-ndk
I am trying to use ndk21 in my project, but when I use libc during linking , I get following error. I tried searching in stackoverflow did not find any specific answer. Has anybody faced similar linker issue . Looks like libc.a does not have reference to methods

llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/libc.a(dl_iterate_phdr_static.o): In function `dl_iterate_phdr':
  bionic/libc/bionic/dl_iterate_phdr_static.cpp:41: undefined reference to `__executable_start'
  bionic/libc/bionic/dl_iterate_phdr_static.cpp:41: undefined reference to `__executable_start'


Ryan Prichard

Nov 29, 2021, 11:51:28 PM11/29/21
It looks like the stub version of dl_iterate_phdr in libc.a is trying to use the __executable_start symbol but can't.

__executable_start is normally a magic symbol that's defined by the linker (e.g. ld.bfd/gold/lld). Maybe Clang is using the macOS ld64 linker for some reason? e.g. pass -v to Clang to see how it's invoking the linker.

libc.a is used for statically-linked executables (as opposed to dynamically-linked executable or dynamic shared libraries). Is that what you're trying to do?


You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages