Hello,
Recently we are make the dynamic linker support GNU-style hash, but for the compatible reason we build android with -Wl,--hash-style=both instead of -Wl,--hash-style=gnu.
And then we discover this bug in gold, gold generate broken sysv-style hash table when --hash-style=both, we already file a bug to bugzilla for bintuils[1].
2012/1/17 Kito Cheng kito@0xlab.org:
Recently we are make the dynamic linker support GNU-style hash, but for the compatible reason we build android with -Wl,--hash-style=both instead of -Wl,--hash-style=gnu.
Thank Kito's observation.
The change was applied in cyanogenmod: http://review.cyanogenmod.com/#change,11448
inker: Support GNU-style hash to speed up symbol lookup
Since 2006, GNU toolchain developers added a new style of hash section to ELF with better performance than the original SysV hash.
GNU hash function uses the DJB (Daniel J Bernstein) hash, which has much fewer symbol conflicts than SysV hash.
GNU hash sections include a Bloom filter, which is used to rapidly reject symbol names that will not be found in the object, avoiding the more expensive hash lookup operation. Normally, only one object in a process has the given symbol. Skipping the hash operation for all the other objects can greatly speed symbol lookup.
And then we discover this bug in gold, gold generate broken sysv-style hash table when --hash-style=both, we already file a bug to bugzilla for bintuils[1].
For some Android applications such as Mozilla (Android version) and the games utilizing Unity3D, they come with their own dynamic linker derived from bionic linker, which only supports SysV hash. Therefore, Kito added "--hash-style=both" to build rules. However, he found new problem resulting from gold linker shipped in Android ICS toolchain.
Can any toolchain hacker take a look at this issue?
Thanks, Jim Huang (jserv) http://0xlab.org/