Page MenuHomePhabricator

[ELF][LLD] Allow reading of more than one FEATURE_1_AND in same object.

Authored by peter.smith on Jun 4 2019, 9:17 AM.



This patch is a follow on from D62853 . Although many relocatable objects will have a single GNU_PROPERTY_X86_FEATURE_1_AND in the section it is permissible to have more than one, and there is a test in ld.bfd that uses it. The behavior that ld.bfd follows is to set the feature bit for a relocatable object if any of the GNU_PROPERTY_X86_FEATURE_1_AND have the feature bit set.

The specific test in ld.bfd is there isn't an X86 equivalent test but the same behaviour can be observed with IBT and SHSTK. I've added a test case for that.

This could be considered a corner case, however it is not known whether tools will just add another GNU_PROPERTY_X86_FEATURE_1_AND rather than find an existing one and add to it.

Diff Detail