empty/missing DT_Hash

5,722 views
Skip to first unread message

tf

unread,
Nov 13, 2013, 7:30:17 AM11/13/13
to andro...@googlegroups.com
Hey guys,

I tried to build newlisp for android for the newest nexus 7. when I
ran it I got "cannot link executable: empty/missing DT_Hash in
"./newlisp" (built with --hash-style=gnu?) Would somebody please
point me in the right direction?

Thanks!

David Turner

unread,
Nov 13, 2013, 11:07:03 AM11/13/13
to andro...@googlegroups.com
The Android dynamic linker doesn't support gnu-style hash tables, try building with --hash-style=sysv or --hash-style=both


--
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 android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/groups/opt_out.

tf

unread,
Nov 13, 2013, 5:07:21 PM11/13/13
to andro...@googlegroups.com


On Wednesday, November 13, 2013 10:07:03 AM UTC-6, Digit wrote:
The Android dynamic linker doesn't support gnu-style hash tables, try building with --hash-style=sysv or --hash-style=both
 
Thank you very much.  Pardon my ignorance, though--where do I specify the hash style? in a file?  ./ndk-build --hash-style=sysv doesn't work... how do I tell the ndk to use a particular hash style?

David Turner

unread,
Nov 14, 2013, 6:00:04 AM11/14/13
to andro...@googlegroups.com
It's a linker flag (see man ld) :-)

ndk-build uses the NDK toolchain which defaults to '--hash-style=sysv' anyway, so this problem shouldn't exist unless you use prebuilt libraries or another build system / toolchain.

In both cases, try regenerating the non-ndk-build  binaries after adding --hash-style=sysv to your LDFLAGS.

Hope this helps.



--

wei chen

unread,
Mar 11, 2016, 10:07:00 AM3/11/16
to android-ndk
Hi Digit,

I have the same problem event if I add the following line in my Android.mk.

LOCAL_LDFLAGS += -Wl,--hash-style=both

the output when  I add the above option:

WARNING: linker: pmdump: unused DT entry: type 0x6ffffef5 arg 0x3b0
WARNING: linker: pmdump: unused DT entry: type 0x6ffffffe arg 0x458
WARNING: linker: pmdump: unused DT entry: type 0x6fffffff arg 0x2
CANNOT LINK EXECUTABLE: cannot locate symbol "__register_atfork" referenced by "pmdump"...

My program named pmdump.

If I remove the above option from my Android.mk, the output:

WARNING: linker: pmdump: unused DT entry: type 0x6ffffef5 arg 0x3b0
WARNING: linker: pmdump: unused DT entry: type 0x6ffffffe arg 0x400
WARNING: linker: pmdump: unused DT entry: type 0x6fffffff arg 0x2
CANNOT LINK EXECUTABLE: empty/missing DT_HASH in "pmdump" (built with --hash-style=gnu?)

I am using the AOSP 6.0 source code and environment to build my program, and the final executable work fine on my device which runs Android 6.0.
And it doesn't work on my another device which runs Android5.1.

I tried to using the AOSP 5.1 source code and environment to build my program without the ld option mentioned above, and the final executable work fine on my device which
runs Android 5.1 as well as my device runs Android 6.0.

It seems like that the difference build process between Android 6.0 and Android 5.1 cause the issue, I want to build my executable and runs well both in devices runs 6.0 and 5.1.

Any suggestion will be appreciated.

Thanks

在 2013年11月14日星期四 UTC+8下午7:00:04,Digit写道:

David Turner

unread,
Mar 16, 2016, 1:11:13 PM3/16/16
to andro...@googlegroups.com
Please don't hijack an existing thread from 2013, start a new one instead. Thanks.

Dan Albert

unread,
Apr 19, 2016, 4:08:46 PM4/19/16
to android-ndk
I am using the AOSP 6.0 source code and environment to build my program, and the final executable work fine on my device which runs Android 6.0.
And it doesn't work on my another device which runs Android5.1.

You can't do that. If you target 6.0, 6.0 is the minimal platform your app will work on. 

10235...@qq.com

unread,
Jul 10, 2017, 10:28:14 AM7/10/17
to android-ndk
I com with the same issue,do you have solve it or some suggestion? I appricate your reply!

在 2016年3月11日星期五 UTC+8下午11:07:00,Chen Wei写道:
Reply all
Reply to author
Forward
0 new messages