[PATCH] D27718: [LLD][ARM] Accept first SHT_ARM_ATTRIBUTES section
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 13 10:14:12 PST 2016
peter.smith created this revision.
peter.smith added reviewers: ruiu, rafael.
peter.smith added a subscriber: llvm-commits.
Herald added subscribers: rengolin, aemerson.
The eglibc C library, as used by Ubuntu 14.04, and similar Debian bases systems, requires the presence of an SHT_ARM_ATTRIBUTES section in for the purposes of checking hard/soft float compatibility when dlopen() is used. Unfortunately when the section is not present dlopen() fails with a generic could not find file message.
This change makes lld keep the first .ARM.attributes section that it encounters and propagates it to the output. This is not a complete SHT_ARM_ATTRIBUTES implementation, that would involve reading the contents of the section and joining each individual attribute. It should suffice for a homogenous build all libraries and executables on the same system with a compatible set of command line options.
My understanding is that later versions of glibc, which eglibc was merged into a couple of years ago do not have this check. However Trusty (14.04) and Debian is common on the consumer devices that people do ARM development on such as Raspberry Pis and Chromebooks so I think it is worth making this change to get dlopen() to work.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 10108 bytes
Desc: not available
More information about the llvm-commits