public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
* RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property
@ 2018-01-01  0:00 H.J. Lu
  2018-01-01  0:00 ` Florian Weimer
  0 siblings, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Binutils, GNU C Library, gnu-gabi, x86-64-abi

Linkers group input note sections with the same name into one output
note section with the same name.  One output note section is placed in
one PT_NOTE segment.  Linkers with GNU property support merge all input
.note.gnu.property sections into one output .note.gnu.property section
with a single NT_GNU_PROPERTY_TYPE_0 note in a single PT_NOTE segment.
Since linkers without GNU property support treat input .note.gnu.property
section as a generic note section and just concatenate all input
.note.gnu.property sections into one output .note.gnu.property section
without merging them, we may see one or more NT_GNU_PROPERTY_TYPE_0 notes
in PT_NOTE segment, which is invalid.

GNU_PROPERTY_X86_UINT32_VALID was defined to address this issue such that
linker sets the bit in values of x86 properties for non-relocatable
outputs.  But it isn't sufficient:

1. It doesn't cover generic properties.
2. When -mx86-used-note=yes is passed to x86 assembler, the
GNU_PROPERTY_X86_UINT32_VALID bit is set in GNU_PROPERTY_X86_ISA_1_USED
property in object file and linkers without GNU property support generate
invalid NT_GNU_PROPERTY_TYPE_0 notes with the GNU_PROPERTY_X86_UINT32_VALID
bit set.

I am proposing the following changes:

1. Add a GNU_PROPERTY_BY_LINKER property which should only be set by
linker for non-relocatable outputs to indicate the property note is
valid and generated by new linkers.  Loaders can check this property
to verify that the property note is valid.
2. Remove GNU_PROPERTY_X86_UINT32_VALID.
3. Define GNU_PROPERTY_X86_ISA_1_BASE for GNU_PROPERTY_X86_ISA_1_USED,
which has the same bit as GNU_PROPERTY_X86_UINT32_VALID and use it
for -mx86-used-note=yes with x86 assembler.

-- 
H.J.

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-12-13 13:02 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-01  0:00 RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property H.J. Lu
2018-01-01  0:00 ` Florian Weimer
2018-01-01  0:00   ` H.J. Lu
2018-01-01  0:00     ` Cary Coutant
2018-01-01  0:00       ` H.J. Lu
2018-01-01  0:00         ` Florian Weimer
2018-01-01  0:00           ` H.J. Lu
2018-01-01  0:00             ` Cary Coutant
2018-01-01  0:00               ` H.J. Lu
2018-01-01  0:00                 ` H.J. Lu
2018-01-01  0:00                   ` RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section H.J. Lu
2018-01-01  0:00                     ` H.J. Lu
2018-01-01  0:00                       ` Florian Weimer
2018-01-01  0:00                         ` H.J. Lu
2018-01-01  0:00                           ` Cary Coutant
2018-01-01  0:00                             ` Mark Wielaard
2018-01-01  0:00                               ` H.J. Lu
2018-01-01  0:00                                 ` Cary Coutant
2018-01-01  0:00                                   ` H.J. Lu
2018-01-01  0:00                               ` Szabolcs Nagy
2018-01-01  0:00                       ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).