PT_NOTE alignment, NT_GNU_PROPERTY_TYPE_0, glibc and gold

H.J. Lu hjl.tools@gmail.com
Thu Aug 16 14:43:00 GMT 2018


On Thu, Aug 16, 2018 at 7:01 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 08/16/2018 03:39 PM, H.J. Lu wrote:
>>
>> On Thu, Aug 16, 2018 at 6:31 AM, Florian Weimer <fweimer@redhat.com>
>> wrote:
>>>
>>> On 08/16/2018 03:19 PM, H.J. Lu wrote:
>>>>
>>>>
>>>> On Thu, Aug 16, 2018 at 6:00 AM, Florian Weimer <fweimer@redhat.com>
>>>> wrote:
>>>>>
>>>>>
>>>>> On 08/07/2018 10:41 PM, H.J. Lu wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> The .note.gnu.property section with NT_GNU_PROPERTY_TYPE_0 has been
>>>>>> added to Linux Extensions to gABI:
>>>>>>
>>>>>> https://github.com/hjl-tools/linux-abi
>>>>>>
>>>>>> GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED are
>>>>>> processor-specific program property types for i386 and x86-64.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> The specification is incomplete as far as alignment matters are
>>>>> concerned.
>>>>
>>>>
>>>>
>>>> https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf
>>>>
>>>> has
>>>>
>>>> 2.1.7 Alignment of Note Sections
>>>>
>>>> All entries in a PT_NOTE segment have the same alignment which equals to
>>>> the
>>>> p_align field in program header.
>>>> According to gABI, each note entry should be aligned to 4 bytes in
>>>> 32-bit
>>>> objects or 8 bytes in 64-bit objects. But .note.ABI-tag section (see
>>>> Section 2.1.6) and .note.gnu.build-id section (see Section 2.1.4) are
>>>> aligned
>>>> to 4 bytes in both 32-bit and 64-bit objects. Note parser should use
>>>> p_align for
>>>> note alignment, instead of assuming alignment based on ELF file class.
>>>
>>>
>>>
>>> This is still ambiguous, particularly based on your comments below.
>>
>>
>> https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf
>>
>> conforms to gABI unless stated otherwise.
>
>
> I still think there is ambiguity.

Can you check out

https://github.com/hjl-tools/linux-abi

and send me a patch to make note alignment less ambiguous?


-- 
H.J.



More information about the Binutils mailing list