https://sourceware.org/bugzilla/show_bug.cgi?id=22914
--- Comment #1 from Cary Coutant <ccoutant at gmail dot com> --- HJ, The linux-abi document leaves a few things unspecified: - Is the .note.gnu.property section SHF_ALLOC or not? - Does it go in the PT_NOTE segment? Should it be placed at the beginning of the segment? - It says the .note.gnu.property section may be combined with other note sections. (Is that true, or is it missing a "not"?) If the linker combines it with other SHT_NOTE sections, does the name matter at all? - Does the linker key off the name of the section, or does it need to parse all SHT_NOTE sections looking for NT_GNU_PROPERTY_TYPE_0 and "GNU"? (Neither option is attractive -- I'd much prefer using a custom section type and program header type, like ARM, MIPS, and Itanium do for their attributes sections. The linker and loader aren't meant to be parsing note sections.) - Where did we end up with note section alignment for 64-bit objects? Is it still 4-byte aligned? On Fri, Mar 2, 2018 at 8:31 AM, hjl.tools at gmail dot com <sourceware-bugzi...@sourceware.org> wrote: > https://sourceware.org/bugzilla/show_bug.cgi?id=22914 > > Bug ID: 22914 > Summary: Gold doesn't support .note.gnu.property section > (NT_GNU_PROPERTY_TYPE_0) > Product: binutils > Version: 2.31 (HEAD) > Status: NEW > Severity: enhancement > Priority: P2 > Component: gold > Assignee: ccoutant at gmail dot com > Reporter: hjl.tools at gmail dot com > CC: ian at airs dot com > Target Milestone: --- > > .note.gnu.property section and NT_GNU_PROPERTY_TYPE_0 are specified in > Linux Extensions to gABI: > > https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf > > [hjl@gnu-cfl-1 gold-2]$ cat x.S > #ifndef NT_GNU_PROPERTY_TYPE_0 > # define NT_GNU_PROPERTY_TYPE_0 5 > #endif > > #ifndef GNU_PROPERTY_STACK_SIZE > # define GNU_PROPERTY_STACK_SIZE 1 > #endif > > #if __SIZEOF_PTRDIFF_T__ == 8 > # define ALIGN 3 > #elif __SIZEOF_PTRDIFF_T__ == 4 > # define ALIGN 2 > #endif > > .section ".note.gnu.property", "a" > .p2align ALIGN > > .long 1f - 0f /* name length */ > .long 5f - 2f /* data length */ > .long NT_GNU_PROPERTY_TYPE_0 /* note type */ > 0: .asciz "GNU" /* vendor name */ > 1: > .p2align ALIGN > 2: .long GNU_PROPERTY_STACK_SIZE /* pr_type. */ > .long 4f - 3f /* pr_datasz. */ > 3: > .dc.a 0x800 /* Stack size. */ > 4: > .p2align ALIGN > 5: > [hjl@gnu-cfl-1 gold-2]$ cat y.S > #ifndef NT_GNU_PROPERTY_TYPE_0 > # define NT_GNU_PROPERTY_TYPE_0 5 > #endif > > #ifndef GNU_PROPERTY_NO_COPY_ON_PROTECTED > # define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 > #endif > > #if __SIZEOF_PTRDIFF_T__ == 8 > # define ALIGN 3 > #elif __SIZEOF_PTRDIFF_T__ == 4 > # define ALIGN 2 > #endif > > .section ".note.gnu.property", "a" > .p2align ALIGN > .long 1f - 0f /* name length */ > .long 3f - 2f /* data length */ > .long NT_GNU_PROPERTY_TYPE_0 /* note type */ > 0: .asciz "GNU" /* vendor name */ > 1: > .p2align ALIGN > 2: .long GNU_PROPERTY_NO_COPY_ON_PROTECTED /* pr_type. */ > .long 0 /* pr_datasz. */ > 3: > .p2align ALIGN > [hjl@gnu-cfl-1 gold-2]$ cat z.S > #ifndef NT_GNU_PROPERTY_TYPE_0 > # define NT_GNU_PROPERTY_TYPE_0 5 > #endif > > #ifndef GNU_PROPERTY_STACK_SIZE > # define GNU_PROPERTY_STACK_SIZE 1 > #endif > > #ifndef GNU_PROPERTY_NO_COPY_ON_PROTECTED > # define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 > #endif > > #if __SIZEOF_PTRDIFF_T__ == 8 > # define ALIGN 3 > #elif __SIZEOF_PTRDIFF_T__ == 4 > # define ALIGN 2 > #endif > > .section ".note.gnu.property", "a" > .p2align ALIGN > .long 1f - 0f /* name length */ > .long 5f - 2f /* data length */ > .long NT_GNU_PROPERTY_TYPE_0 /* note type */ > 0: .asciz "GNU" /* vendor name */ > 1: > .p2align ALIGN > 2: .long GNU_PROPERTY_STACK_SIZE /* pr_type. */ > .long 4f - 3f /* pr_datasz. */ > 3: > .dc.a 0x111100 /* Stack size. */ > 4: > .p2align ALIGN > .long GNU_PROPERTY_NO_COPY_ON_PROTECTED /* pr_type. */ > .long 0 /* pr_datasz. */ > .p2align ALIGN > 5: > [hjl@gnu-cfl-1 gold-2]$ cat bar.c > void > _start (void) > { > } > [hjl@gnu-cfl-1 gold-2]$ make > gcc -B./ -c -o x.o x.S > gcc -B./ -c -o y.o y.S > gcc -B./ -c -o z.o z.S > gcc -B./ -c -o bar.o bar.c > ./ld -o x x.o y.o z.o bar.o > ld -o y x.o y.o z.o bar.o > readelf -n x y > > File: x > > Displaying notes found in: .note.gnu.property > Owner Data size Description > GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 > Properties: stack size: 0x800 > GNU 0x00000008 NT_GNU_PROPERTY_TYPE_0 > Properties: no copy on protected > GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0 > Properties: stack size: 0x111100 > no copy on protected > > Displaying notes found in: .note.gnu.gold-version > Owner Data size Description > GNU 0x00000009 NT_GNU_GOLD_VERSION (gold version) > Version: gold 1.15 > > File: y > > Displaying notes found in: .note.gnu.property > Owner Data size Description > GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0 > Properties: stack size: 0x111100 > no copy on protected > [hjl@gnu-cfl-1 gold-2]$ > > -- > You are receiving this mail because: > You are the assignee for the bug. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils