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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                     ` 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
  1 sibling, 1 reply; 21+ messages in thread
From: Florian Weimer @ 2018-01-01  0:00 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Cary Coutant, Binutils, GNU C Library, gnu-gabi, x86-64-abi

* H. J. Lu:

> diff --git a/ld/testsuite/ld-elf/pr23900-1b.d b/ld/testsuite/ld-elf/pr23900-1b.d
> new file mode 100644
> index 0000000000..e1555c29f6
> --- /dev/null
> +++ b/ld/testsuite/ld-elf/pr23900-1b.d
> @@ -0,0 +1,14 @@
> +#source: pr23900-1.s
> +#ld:
> +#readelf: -l --wide
> +#target: *-*-linux* *-*-gnu* *-*-nacl*
> +
> +#...
> +  GNU_PROPERTY .*
> +#...
> + +[0-9]+ +\.note\.gnu\.property 
> +#...
> + +[0-9]+ +\.note\.gnu\.property 
> +#...
> + +[0-9]+ +\.note\.gnu\.property 
> +#...

Sholdn't there be a test that checks that the segment alignment is as
expected?

What happened to the earlier concerns that the presence of
PT_GNU_PROPERTY will break some existing installations?

I would strongly recommended to try harder to get consensus here.  I do
not want to be a in a situation were we revise ABI again two years from
now.

Thanks,
Florian

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

* Re: RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property
  2018-01-01  0:00     ` Cary Coutant
@ 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: Cary Coutant
  Cc: Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

On Mon, Nov 26, 2018 at 2:34 PM Cary Coutant <ccoutant@gmail.com> wrote:
>
> > > > 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.
> > >
> > > Okay.
>
> Does this imply that the property notes in all pre-existing binaries
> can't be trusted?

Loader needs to make extra effort to check if property notes are valid:

https://sourceware.org/bugzilla/show_bug.cgi?id=23509

> > > > 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.
> > >
> > > Surely this is a GAS bug?  Why not fix that bug?
> >
> > Linker removes GNU_PROPERTY_X86_ISA_1_USED when its value is empty.
> > Maybe linker shouldn't do that.
>
> Please explain how that answers Florian's question? You lost me.
>
> What exactly are you saying the linker should not do? In your Aug. 10
> proposal, ISA_1_USED is in the UINT32_OR_AND range, which specifically
> says the bit should only be set in the output if *all* input files
> contain the property (although it's unclear whether you meant "this
> property is present in all relocatable input files" to mean a non-zero
> property in all input files).

No.  A property can have zero bits.  I updated my proposal to:

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.

> > > > 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.
> > >
> > > The alternative approach would be to switch to a new PT_ segment for
> > > this because those aren't included in relocatable objects.  (Maybe it's
> > > time for another approach.)
> >
> > PT_NOTE is used so that binaries with GNU properties are backward
> > compatible with loaders which don't support GNU properties. They will
> > run without any new features from GNU properties.
>
> With both your Aug. 10 proposal and this one, you're throwing
> compatibility out the window by saying the loader shouldn't trust
> those old notes without VALID bits. Can't we use this opportunity to

This has been handled.

> just do it right? At this point, I don't really care if you keep on
> using SHT_NOTE for the properties in relocatable files, but please,
> let's use a proper PT_GNU_PROPERTY segment for executables. (Sorry, I
> promised to yield to the consensus, but the design keeps getting more
> complicated.)
>

PT_GNU_PROPERTY isn't compatible with existing loaders.  This needs
to be both forward and backward compatible.

--
H.J.

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

* RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                 ` H.J. Lu
@ 2018-01-01  0:00                   ` H.J. Lu
  2018-01-01  0:00                     ` H.J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Cary Coutant
  Cc: Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]

On Tue, Nov 27, 2018 at 3:59 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Tue, Nov 27, 2018 at 11:25 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Tue, Nov 27, 2018 at 9:56 AM Cary Coutant <ccoutant@gmail.com> wrote:
> > >
> > > > > > PT_GNU_PROPERTY isn't compatible with existing loaders.  This needs
> > > > > > to be both forward and backward compatible.
> > > > >
> > > > > Which loaders?  The kernel?
> > > >
> > > > Kernel, glibc, gdb, .....
> > >
> > > How is that any different from using PT_NOTE? Existing loaders don't
> > > handle that either.
> > >
> > > If you're claiming that a new PT_ value in the program header table
> > > will be rejected by existing loaders, that's a bug. It should be
> > > fixed. The whole principle of ELF extensibility relies on that.
> >
> > Add PT_GNU_PROPERTY to cover .note.gnu.property section?
>
> Like:
>
> 1. Add PT_GNU_PROPERTY segment type.
>
>  # define PT_GNU_PROPERTY (PT_LOOS + 0x474e553)
>
> which covers .note.gnu.property section.
> 2. Remove GNU_PROPERTY_X86_UINT32_VALID.
>

Here is a patch.  The updated pdf is at

https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf

-- 
H.J.

[-- Attachment #2: 0001-Add-PT_GNU_PROPERTY-to-cover-.note.gnu.property-sect.patch --]
[-- Type: application/x-patch, Size: 1087 bytes --]

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

* Re: RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property
  2018-01-01  0:00 ` Florian Weimer
@ 2018-01-01  0:00   ` H.J. Lu
  2018-01-01  0:00     ` Cary Coutant
  0 siblings, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Binutils, GNU C Library, gnu-gabi, x86-64-abi

On Mon, Nov 26, 2018 at 5:12 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> > 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.
>
> Okay.
>
> > 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.
>
> Surely this is a GAS bug?  Why not fix that bug?

Linker removes GNU_PROPERTY_X86_ISA_1_USED when its value is empty.
Maybe linker shouldn't do that.

> > 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.
>
> The alternative approach would be to switch to a new PT_ segment for
> this because those aren't included in relocatable objects.  (Maybe it's
> time for another approach.)

PT_NOTE is used so that binaries with GNU properties are backward
compatible with loaders which don't support GNU properties. They will
run without any new features from GNU properties.

-- 
H.J.

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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                               ` H.J. Lu
@ 2018-01-01  0:00                                 ` Cary Coutant
  2018-01-01  0:00                                   ` H.J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Cary Coutant @ 2018-01-01  0:00 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Mark Wielaard, Florian Weimer, Binutils, GNU C Library, gnu-gabi,
	x86-64-abi

> > > As you might expect, I support this new program header. Ideally, I'd
> > > have liked to replace the input SHT_NOTE sections with
> > > SHT_GNU_PROPERTY sections and dispense with all the note section
> > > overhead, but I'll take this as a compromise.
> >
> > Why can't we switch to SHT_GNU_PROPERTY? My fear with combining
> > PT_GNU_PROPERTY with SHT_NOTE is that it will be even more confusing
>
> There is no requirement for PT_XXX to have SHT_XXX, like PT_GNU_RELRO.

But it is not normal for the linker to perform such special processing
on an SHT_NOTE section. When a section requires special processing, it
is customary to use a new section type. Otherwise, the linker has to
resort to string matching on the section name. Section names in ELF
are not supposed to have special meaning to the linker.

> > Also I thought there was still a question whether any or all
> > newly proposed property features and flags are actually needed
> > as loadable segments. There is a clear overlap with the GNU
> > Attributes (which are non-loadable). I would like to see consensus
> > first on the new property format/flags and which are and which
> > aren't needed as loadable properties at runtime.
>
> Yes, they are needed in loadable segment.  That is the main motivation
> for GNU program property,

The only properties required in a loadable segment are those that will
be used by the loader. From what I can tell so far, the USED bits
can't be used by the loader, so why can't they go in the GNU
attributes section?

-cary

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

* Re: RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property
  2018-01-01  0:00           ` H.J. Lu
@ 2018-01-01  0:00             ` Cary Coutant
  2018-01-01  0:00               ` H.J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Cary Coutant @ 2018-01-01  0:00 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

> > > PT_GNU_PROPERTY isn't compatible with existing loaders.  This needs
> > > to be both forward and backward compatible.
> >
> > Which loaders?  The kernel?
>
> Kernel, glibc, gdb, .....

How is that any different from using PT_NOTE? Existing loaders don't
handle that either.

If you're claiming that a new PT_ value in the program header table
will be rejected by existing loaders, that's a bug. It should be
fixed. The whole principle of ELF extensibility relies on that.

-cary

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

* Re: 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
  2018-01-01  0:00           ` H.J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Florian Weimer @ 2018-01-01  0:00 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Cary Coutant, Binutils, GNU C Library, gnu-gabi, x86-64-abi

* H. J. Lu:

>> just do it right? At this point, I don't really care if you keep on
>> using SHT_NOTE for the properties in relocatable files, but please,
>> let's use a proper PT_GNU_PROPERTY segment for executables. (Sorry, I
>> promised to yield to the consensus, but the design keeps getting more
>> complicated.)
>>
>
> PT_GNU_PROPERTY isn't compatible with existing loaders.  This needs
> to be both forward and backward compatible.

Which loaders?  The kernel?

Thanks,
Florian

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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  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                       ` H.J. Lu
  2018-01-01  0:00                       ` Florian Weimer
  0 siblings, 2 replies; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Cary Coutant
  Cc: Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

On Wed, Nov 28, 2018 at 9:27 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Tue, Nov 27, 2018 at 3:59 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Tue, Nov 27, 2018 at 11:25 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Tue, Nov 27, 2018 at 9:56 AM Cary Coutant <ccoutant@gmail.com> wrote:
> > > >
> > > > > > > PT_GNU_PROPERTY isn't compatible with existing loaders.  This needs
> > > > > > > to be both forward and backward compatible.
> > > > > >
> > > > > > Which loaders?  The kernel?
> > > > >
> > > > > Kernel, glibc, gdb, .....
> > > >
> > > > How is that any different from using PT_NOTE? Existing loaders don't
> > > > handle that either.
> > > >
> > > > If you're claiming that a new PT_ value in the program header table
> > > > will be rejected by existing loaders, that's a bug. It should be
> > > > fixed. The whole principle of ELF extensibility relies on that.
> > >
> > > Add PT_GNU_PROPERTY to cover .note.gnu.property section?
> >
> > Like:
> >
> > 1. Add PT_GNU_PROPERTY segment type.
> >
> >  # define PT_GNU_PROPERTY (PT_LOOS + 0x474e553)
> >
> > which covers .note.gnu.property section.
> > 2. Remove GNU_PROPERTY_X86_UINT32_VALID.
> >
>
> Here is a patch.  The updated pdf is at
>
> https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf

Here is the patch to support PT_GNU_PROPERTY.   Any comments?

-- 
H.J.

[-- Attachment #2: 0001-elf-Add-PT_GNU_PROPERTY-segment-type.patch --]
[-- Type: text/x-patch, Size: 49426 bytes --]

From 77d5a8e3eef110608d822490bfb329dde5c50962 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 27 Nov 2018 15:55:11 -0800
Subject: [PATCH] elf: Add PT_GNU_PROPERTY segment type

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.  New linkers 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 older
linkers 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
are invalid.

GNU_PROPERTY_X86_UINT32_VALID was defined to address this issue such
that linker sets the bit 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 older linkers 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 PT_GNU_PROPERTY segment type:

 # define PT_GNU_PROPERTY (PT_LOOS + 0x474e553)

which covers .note.gnu.property section.
2. Remove GNU_PROPERTY_X86_UINT32_VALID.

bfd/

	PR ld/23900
	* elf.c (get_program_header_size): Add a PT_GNU_PROPERTY
	segment for NOTE_GNU_PROPERTY_SECTION_NAME.
	(_bfd_elf_map_sections_to_segments): Create a PT_GNU_PROPERTY
	segment for NOTE_GNU_PROPERTY_SECTION_NAME.
	* elfxx-x86.c (_bfd_elf_link_setup_gnu_properties): Don't set
	GNU_PROPERTY_X86_UINT32_VALID.

binutils/

	PR ld/23900
	* readelf.c (get_segment_type): Support PT_GNU_PROPERTY.
	(decode_x86_isa): Don't check GNU_PROPERTY_X86_UINT32_VALID.
	(decode_x86_feature_1): Likewise.
	(decode_x86_feature_2): Likewise.
	(print_gnu_property_note): Remove GNU_PROPERTY_X86_UINT32_VALID
	check.
	* testsuite/binutils-all/i386/empty.d: Updated.
	* testsuite/binutils-all/x86-64/empty-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/empty.d: Likewise.
	* testsuite/binutils-all/i386/pr21231b.s: Change
	GNU_PROPERTY_X86_ISA_1_USED bits to 0x7fffffff.
	* testsuite/binutils-all/x86-64/pr21231b.s: Likewise.

gas/

	PR ld/23900
	* config/tc-i386.c (x86_cleanup): Don't set
	GNU_PROPERTY_X86_UINT32_VALID.
	* testsuite/gas/i386/property-1.s: Change
	GNU_PROPERTY_X86_ISA_1_USED bits to 0.

include/

	PR ld/23900
	* elf/common.h (PT_GNU_PROPERTY): New.
	(GNU_PROPERTY_X86_UINT32_VALID): Removed.

ld/

	PR ld/23900
	* testsuite/ld-elf/pr23900-1.s: New file.
	* testsuite/ld-elf/pr23900-1a.d: Likewise.
	* testsuite/ld-elf/pr23900-1b.d: Likewise.
	* testsuite/ld-elf/pr23900-2.s: Likewise.
	* testsuite/ld-elf/pr23900-2a.d: Likewise.
	* testsuite/ld-elf/pr23900-2b.d: Likewise.
	* testsuite/ld-i386/ibt-plt-1.d: Adjusted.
	* testsuite/ld-i386/ibt-plt-2c.d: Likewise.
	* testsuite/ld-i386/ibt-plt-2d.d: Likewise.
	* testsuite/ld-i386/ibt-plt-3d.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-1.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2d-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3d-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3d.d: Likewise.
	* testsuite/ld-i386/pr23372c.d: Expect <None>
	for GNU_PROPERTY_X86_ISA_1_USED.
	* testsuite/ld-x86-64/pr23372c-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372c.d: Likewise.
	* testsuite/ld-x86-64/pr23372d-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372d.d: Likewise.
	* testsuite/ld-x86-64/property-x86-5a.s: Change
	GNU_PROPERTY_X86_ISA_1_USED bits to 0.
	* testsuite/ld-x86-64/property-x86-5b.s: Likewise.
---
 bfd/elf.c                                     | 26 +++++++++++++++
 bfd/elfxx-x86.c                               | 10 ++----
 binutils/readelf.c                            | 21 +++---------
 binutils/testsuite/binutils-all/i386/empty.d  |  2 +-
 .../testsuite/binutils-all/i386/pr21231b.s    |  2 +-
 .../testsuite/binutils-all/x86-64/empty-x32.d |  2 +-
 .../testsuite/binutils-all/x86-64/empty.d     |  2 +-
 .../testsuite/binutils-all/x86-64/pr21231b.s  |  2 +-
 gas/config/tc-i386.c                          |  1 -
 gas/testsuite/gas/i386/property-1.s           |  3 +-
 include/elf/common.h                          |  4 +--
 ld/testsuite/ld-elf/pr23900-1.s               | 30 +++++++++++++++++
 ld/testsuite/ld-elf/pr23900-1a.d              |  9 ++++++
 ld/testsuite/ld-elf/pr23900-1b.d              | 14 ++++++++
 ld/testsuite/ld-elf/pr23900-2.s               | 32 +++++++++++++++++++
 ld/testsuite/ld-elf/pr23900-2a.d              |  9 ++++++
 ld/testsuite/ld-elf/pr23900-2b.d              |  9 ++++++
 ld/testsuite/ld-i386/ibt-plt-1.d              | 22 ++++++-------
 ld/testsuite/ld-i386/ibt-plt-2c.d             | 22 ++++++-------
 ld/testsuite/ld-i386/ibt-plt-2d.d             | 20 ++++++------
 ld/testsuite/ld-i386/ibt-plt-3d.d             | 20 ++++++------
 ld/testsuite/ld-i386/pr23372c.d               |  2 +-
 ld/testsuite/ld-x86-64/ibt-plt-1-x32.d        | 24 +++++++-------
 ld/testsuite/ld-x86-64/ibt-plt-1.d            | 24 +++++++-------
 ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d       | 24 +++++++-------
 ld/testsuite/ld-x86-64/ibt-plt-2c.d           | 24 +++++++-------
 ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d       | 14 ++++----
 ld/testsuite/ld-x86-64/ibt-plt-2d.d           | 14 ++++----
 ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d       | 24 +++++++-------
 ld/testsuite/ld-x86-64/ibt-plt-3c.d           | 24 +++++++-------
 ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d       | 14 ++++----
 ld/testsuite/ld-x86-64/ibt-plt-3d.d           | 14 ++++----
 ld/testsuite/ld-x86-64/pr23372c-x32.d         |  2 +-
 ld/testsuite/ld-x86-64/pr23372c.d             |  2 +-
 ld/testsuite/ld-x86-64/property-x86-5a.s      |  3 +-
 ld/testsuite/ld-x86-64/property-x86-5b.s      |  3 +-
 36 files changed, 291 insertions(+), 183 deletions(-)
 create mode 100644 ld/testsuite/ld-elf/pr23900-1.s
 create mode 100644 ld/testsuite/ld-elf/pr23900-1a.d
 create mode 100644 ld/testsuite/ld-elf/pr23900-1b.d
 create mode 100644 ld/testsuite/ld-elf/pr23900-2.s
 create mode 100644 ld/testsuite/ld-elf/pr23900-2a.d
 create mode 100644 ld/testsuite/ld-elf/pr23900-2b.d

diff --git a/bfd/elf.c b/bfd/elf.c
index 604971dd4c..0cc74e51a4 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4372,6 +4372,14 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info)
       ++segs;
     }
 
+  s = bfd_get_section_by_name (abfd,
+			       NOTE_GNU_PROPERTY_SECTION_NAME);
+  if (s != NULL && s->size != 0)
+    {
+      /* We need a PT_GNU_PROPERTY segment.  */
+      ++segs;
+    }
+
   for (s = abfd->sections; s != NULL; s = s->next)
     {
       if ((s->flags & SEC_LOAD) != 0
@@ -5055,6 +5063,24 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
 	      pm = &m->next;
 	    }
 
+      s = bfd_get_section_by_name (abfd,
+				   NOTE_GNU_PROPERTY_SECTION_NAME);
+      if (s != NULL && s->size != 0)
+	{
+	  amt = sizeof (struct elf_segment_map) + sizeof (asection *);
+	  m = bfd_zalloc (abfd, amt);
+	  if (m == NULL)
+	    goto error_return;
+	  m->next = NULL;
+	  m->p_type = PT_GNU_PROPERTY;
+	  m->count = 1;
+	  m->p_flags_valid = 1;
+	  m->sections[0] = s;
+	  m->p_flags = PF_R;
+	  *pm = m;
+	  pm = &m->next;
+	}
+
       /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME
 	 segment.  */
       eh_frame_hdr = elf_eh_frame_hdr (abfd);
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index bf205d6d3b..56ae192ea6 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -2928,8 +2928,9 @@ error_alignment:
 /* Fix up x86 GNU properties.  */
 
 void
-_bfd_x86_elf_link_fixup_gnu_properties (struct bfd_link_info *info,
-					elf_property_list **listp)
+_bfd_x86_elf_link_fixup_gnu_properties
+  (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+   elf_property_list **listp)
 {
   elf_property_list *p;
 
@@ -2957,11 +2958,6 @@ _bfd_x86_elf_link_fixup_gnu_properties (struct bfd_link_info *info,
 	      continue;
 	    }
 
-	  /* Mark x86-specific properties with X86_UINT32_VALID for
-	     non-relocatable output.  */
-	  if (!bfd_link_relocatable (info))
-	    p->property.u.number |= GNU_PROPERTY_X86_UINT32_VALID;
-
 	  listp = &p->next;
 	}
       else if (type > GNU_PROPERTY_HIPROC)
diff --git a/binutils/readelf.c b/binutils/readelf.c
index afb039f7b7..48388a5d15 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -3930,6 +3930,7 @@ get_segment_type (Filedata * filedata, unsigned long p_type)
     case PT_GNU_EH_FRAME: return "GNU_EH_FRAME";
     case PT_GNU_STACK:	return "GNU_STACK";
     case PT_GNU_RELRO:  return "GNU_RELRO";
+    case PT_GNU_PROPERTY: return "GNU_PROPERTY";
 
     default:
       if (p_type >= PT_GNU_MBIND_LO && p_type <= PT_GNU_MBIND_HI)
@@ -17018,13 +17019,11 @@ decode_x86_compat_isa (unsigned int bitmask)
 static void
 decode_x86_isa (unsigned int bitmask)
 {
-  if (bitmask == GNU_PROPERTY_X86_UINT32_VALID)
+  if (!bitmask)
     {
       printf (_("<None>"));
       return;
     }
-  else
-    bitmask &= ~GNU_PROPERTY_X86_UINT32_VALID;
 
   while (bitmask)
     {
@@ -17117,13 +17116,11 @@ decode_x86_isa (unsigned int bitmask)
 static void
 decode_x86_feature_1 (unsigned int bitmask)
 {
-  if (bitmask == GNU_PROPERTY_X86_UINT32_VALID)
+  if (!bitmask)
     {
       printf (_("<None>"));
       return;
     }
-  else
-    bitmask &= ~GNU_PROPERTY_X86_UINT32_VALID;
 
   while (bitmask)
     {
@@ -17150,13 +17147,11 @@ decode_x86_feature_1 (unsigned int bitmask)
 static void
 decode_x86_feature_2 (unsigned int bitmask)
 {
-  if (bitmask == GNU_PROPERTY_X86_UINT32_VALID)
+  if (!bitmask)
     {
       printf (_("<None>"));
       return;
     }
-  else
-    bitmask &= ~GNU_PROPERTY_X86_UINT32_VALID;
 
   while (bitmask)
     {
@@ -17252,13 +17247,7 @@ print_gnu_property_note (Filedata * filedata, Elf_Internal_Note * pnote)
 	      unsigned int bitmask;
 
 	      if (datasz == 4)
-		{
-		  bitmask = byte_get (ptr, 4);
-		  if ((filedata->file_header.e_type == ET_EXEC
-		       || filedata->file_header.e_type == ET_DYN)
-		      && !(bitmask & GNU_PROPERTY_X86_UINT32_VALID))
-		    printf ("Invalid ");
-		}
+		bitmask = byte_get (ptr, 4);
 	      else
 		bitmask = 0;
 
diff --git a/binutils/testsuite/binutils-all/i386/empty.d b/binutils/testsuite/binutils-all/i386/empty.d
index 809280f73f..3c0e860a5e 100644
--- a/binutils/testsuite/binutils-all/i386/empty.d
+++ b/binutils/testsuite/binutils-all/i386/empty.d
@@ -6,7 +6,7 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 feature: 
+      Properties: x86 feature: <None>
   GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 ISA used: <None>
 	x86 feature used: x86
diff --git a/binutils/testsuite/binutils-all/i386/pr21231b.s b/binutils/testsuite/binutils-all/i386/pr21231b.s
index 793e282471..1fd2575e2a 100644
--- a/binutils/testsuite/binutils-all/i386/pr21231b.s
+++ b/binutils/testsuite/binutils-all/i386/pr21231b.s
@@ -22,7 +22,7 @@
 	.long 0xc0010000	/* pr_type.  */
 	.long 4f - 3f		/* pr_datasz.  */
 3:
-	.long -1
+	.long 0x7fffffff
 4:
 	.p2align 2
 	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
diff --git a/binutils/testsuite/binutils-all/x86-64/empty-x32.d b/binutils/testsuite/binutils-all/x86-64/empty-x32.d
index f6503746e8..32cc55e349 100644
--- a/binutils/testsuite/binutils-all/x86-64/empty-x32.d
+++ b/binutils/testsuite/binutils-all/x86-64/empty-x32.d
@@ -7,7 +7,7 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 feature: 
+      Properties: x86 feature: <None>
   GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 ISA used: <None>
 	x86 feature used: x86
diff --git a/binutils/testsuite/binutils-all/x86-64/empty.d b/binutils/testsuite/binutils-all/x86-64/empty.d
index 30a2ea4830..3cc52ba2e8 100644
--- a/binutils/testsuite/binutils-all/x86-64/empty.d
+++ b/binutils/testsuite/binutils-all/x86-64/empty.d
@@ -6,7 +6,7 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 feature: 
+      Properties: x86 feature: <None>
   GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 ISA used: <None>
 	x86 feature used: x86
diff --git a/binutils/testsuite/binutils-all/x86-64/pr21231b.s b/binutils/testsuite/binutils-all/x86-64/pr21231b.s
index add9227977..8fefebdb2f 100644
--- a/binutils/testsuite/binutils-all/x86-64/pr21231b.s
+++ b/binutils/testsuite/binutils-all/x86-64/pr21231b.s
@@ -22,7 +22,7 @@
 	.long 0xc0010000	/* pr_type.  */
 	.long 4f - 3f		/* pr_datasz.  */
 3:
-	.long -1
+	.long 0x7fffffff
 4:
 	.p2align 3
 	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 4fe9f0dda6..8e25e6c7a0 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7896,7 +7896,6 @@ x86_cleanup (void)
   if (!IS_ELF || !x86_used_note)
     return;
 
-  x86_isa_1_used |= GNU_PROPERTY_X86_UINT32_VALID;
   x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_X86;
 
   /* The .note.gnu.property section layout:
diff --git a/gas/testsuite/gas/i386/property-1.s b/gas/testsuite/gas/i386/property-1.s
index 8857c11496..4c29380447 100644
--- a/gas/testsuite/gas/i386/property-1.s
+++ b/gas/testsuite/gas/i386/property-1.s
@@ -20,8 +20,7 @@
 	.long 0xc0010000	/* pr_type.  */
 	.long 5f - 4f		/* pr_datasz.  */
 4:
-	/* GNU_PROPERTY_X86_UINT32_VALID */
-	.long 0x80000000
+	.long 0
 5:
 .ifdef __64_bit__
 	.p2align 3
diff --git a/include/elf/common.h b/include/elf/common.h
index da9ea036f4..1b3d713689 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -469,6 +469,7 @@
 #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
 #define PT_GNU_STACK	(PT_LOOS + 0x474e551) /* Stack flags */
 #define PT_GNU_RELRO	(PT_LOOS + 0x474e552) /* Read-only after relocation */
+#define PT_GNU_PROPERTY	(PT_LOOS + 0x474e553) /* GNU property */
 
 /* Mbind segments */
 #define PT_GNU_MBIND_NUM 4096
@@ -799,9 +800,6 @@
 #define GNU_PROPERTY_X86_FEATURE_2_USED \
   (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1)
 
-/* Set by linker to indicate that the property is valid.  */
-#define GNU_PROPERTY_X86_UINT32_VALID		(1U << 31)
-
 #define GNU_PROPERTY_X86_FEATURE_1_IBT		(1U << 0)
 #define GNU_PROPERTY_X86_FEATURE_1_SHSTK	(1U << 1)
 
diff --git a/ld/testsuite/ld-elf/pr23900-1.s b/ld/testsuite/ld-elf/pr23900-1.s
new file mode 100644
index 0000000000..b0b54ed448
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-1.s
@@ -0,0 +1,30 @@
+	.text
+	.global start	/* Used by SH targets.  */
+start:
+	.global _start
+_start:
+	.global __start
+__start:
+	.global main	/* Used by HPPA targets.  */
+main:
+	.globl	_main	/* Used by LynxOS targets.  */
+_main:
+	.dc.a 0
+
+	.section .note.gnu.property, "a"
+	.p2align ALIGN
+	.dc.l .L1 - .L0		/* name length.  */
+	.dc.l .L3 - .L1		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.dc.l 5			/* note type.  */
+.L0:
+	.asciz "GNU"		/* vendor name.  */
+.L1:
+	.p2align ALIGN
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+	.dc.l 2			/* pr_type.  */
+	.dc.l .L5 - .L4		/* pr_datasz.  */
+.L4:
+.L5:
+	.p2align ALIGN
+.L3:
diff --git a/ld/testsuite/ld-elf/pr23900-1a.d b/ld/testsuite/ld-elf/pr23900-1a.d
new file mode 100644
index 0000000000..becde98814
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-1a.d
@@ -0,0 +1,9 @@
+#source: pr23900-1.s
+#ld:
+#readelf: --notes --wide
+#target: *-*-linux* *-*-gnu* *-*-nacl*
+
+#...
+Displaying notes found in: \.note\.gnu\.property
+[ 	]+Owner[ 	]+Data size[ 	]+Description
+[ 	]+GNU[ 	]+0x0+..[ 	]+NT_GNU_PROPERTY_TYPE_0[ 	]+Properties: no copy on protected 
diff --git a/ld/testsuite/ld-elf/pr23900-1b.d b/ld/testsuite/ld-elf/pr23900-1b.d
new file mode 100644
index 0000000000..e1555c29f6
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-1b.d
@@ -0,0 +1,14 @@
+#source: pr23900-1.s
+#ld:
+#readelf: -l --wide
+#target: *-*-linux* *-*-gnu* *-*-nacl*
+
+#...
+  GNU_PROPERTY .*
+#...
+ +[0-9]+ +\.note\.gnu\.property 
+#...
+ +[0-9]+ +\.note\.gnu\.property 
+#...
+ +[0-9]+ +\.note\.gnu\.property 
+#...
diff --git a/ld/testsuite/ld-elf/pr23900-2.s b/ld/testsuite/ld-elf/pr23900-2.s
new file mode 100644
index 0000000000..cfff675276
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-2.s
@@ -0,0 +1,32 @@
+	.text
+	.global start	/* Used by SH targets.  */
+start:
+	.global _start
+_start:
+	.global __start
+__start:
+	.global main	/* Used by HPPA targets.  */
+main:
+	.globl	_main	/* Used by LynxOS targets.  */
+_main:
+	.dc.a 0
+
+	/* NB: Deliberately incorrect section name.  Should be
+	       .note.gnu.property.  */
+	.section .note, "a"
+	.p2align ALIGN
+	.dc.l .L1 - .L0		/* name length.  */
+	.dc.l .L3 - .L1		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.dc.l 5			/* note type.  */
+.L0:
+	.asciz "GNU"		/* vendor name.  */
+.L1:
+	.p2align ALIGN
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+	.dc.l 2			/* pr_type.  */
+	.dc.l .L5 - .L4		/* pr_datasz.  */
+.L4:
+.L5:
+	.p2align ALIGN
+.L3:
diff --git a/ld/testsuite/ld-elf/pr23900-2a.d b/ld/testsuite/ld-elf/pr23900-2a.d
new file mode 100644
index 0000000000..836606d410
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-2a.d
@@ -0,0 +1,9 @@
+#source: pr23900-2.s
+#ld:
+#readelf: --notes --wide
+#target: *-*-linux* *-*-gnu* *-*-nacl*
+
+#...
+Displaying notes found in: \.note
+[ 	]+Owner[ 	]+Data size[ 	]+Description
+[ 	]+GNU[ 	]+0x0+..[ 	]+NT_GNU_PROPERTY_TYPE_0[ 	]+Properties: no copy on protected 
diff --git a/ld/testsuite/ld-elf/pr23900-2b.d b/ld/testsuite/ld-elf/pr23900-2b.d
new file mode 100644
index 0000000000..2aa04d760c
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-2b.d
@@ -0,0 +1,9 @@
+#source: pr23900-2.s
+#ld:
+#readelf: -l --wide
+#target: *-*-linux* *-*-gnu* *-*-nacl*
+
+#failif
+#...
+  GNU_PROPERTY .*
+#...
diff --git a/ld/testsuite/ld-i386/ibt-plt-1.d b/ld/testsuite/ld-i386/ibt-plt-1.d
index 2a8e0438a1..beccbf7b2b 100644
--- a/ld/testsuite/ld-i386/ibt-plt-1.d
+++ b/ld/testsuite/ld-i386/ibt-plt-1.d
@@ -7,45 +7,45 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
+[a-f0-9]+ <.plt>:
  +[a-f0-9]+:	ff b3 04 00 00 00    	pushl  0x4\(%ebx\)
  +[a-f0-9]+:	ff a3 08 00 00 00    	jmp    \*0x8\(%ebx\)
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%eax\)
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	68 00 00 00 00       	push   \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	68 08 00 00 00       	push   \$0x8
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	ff a3 0c 00 00 00    	jmp    \*0xc\(%ebx\)
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	ff a3 10 00 00 00    	jmp    \*0x10\(%ebx\)
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	53                   	push   %ebx
- +[a-f0-9]+:	e8 18 00 00 00       	call   1ce <__x86.get_pc_thunk.bx>
- +[a-f0-9]+:	81 c3 36 11 00 00    	add    \$0x1136,%ebx
+ +[a-f0-9]+:	e8 18 00 00 00       	call   [a-f0-9]+ <__x86.get_pc_thunk.bx>
+ +[a-f0-9]+:	81 c3 ([0-9a-f]{2} ){4}[ 	]+add    \$0x[a-f0-9]+,%ebx
  +[a-f0-9]+:	83 ec 08             	sub    \$0x8,%esp
- +[a-f0-9]+:	e8 dc ff ff ff       	call   1a0 <bar2@plt>
- +[a-f0-9]+:	e8 c7 ff ff ff       	call   190 <bar1@plt>
+ +[a-f0-9]+:	e8 dc ff ff ff       	call   [a-f0-9]+ <bar2@plt>
+ +[a-f0-9]+:	e8 c7 ff ff ff       	call   [a-f0-9]+ <bar1@plt>
  +[a-f0-9]+:	83 c4 08             	add    \$0x8,%esp
  +[a-f0-9]+:	5b                   	pop    %ebx
  +[a-f0-9]+:	c3                   	ret    
 
-0+1ce <__x86.get_pc_thunk.bx>:
+[a-f0-9]+ <__x86.get_pc_thunk.bx>:
  +[a-f0-9]+:	8b 1c 24             	mov    \(%esp\),%ebx
  +[a-f0-9]+:	c3                   	ret    
 #pass
diff --git a/ld/testsuite/ld-i386/ibt-plt-2c.d b/ld/testsuite/ld-i386/ibt-plt-2c.d
index d71f34d27c..7193034f78 100644
--- a/ld/testsuite/ld-i386/ibt-plt-2c.d
+++ b/ld/testsuite/ld-i386/ibt-plt-2c.d
@@ -8,45 +8,45 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
+[a-f0-9]+ <.plt>:
  +[a-f0-9]+:	ff b3 04 00 00 00    	pushl  0x4\(%ebx\)
  +[a-f0-9]+:	ff a3 08 00 00 00    	jmp    \*0x8\(%ebx\)
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%eax\)
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	68 00 00 00 00       	push   \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	68 08 00 00 00       	push   \$0x8
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	ff a3 0c 00 00 00    	jmp    \*0xc\(%ebx\)
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	ff a3 10 00 00 00    	jmp    \*0x10\(%ebx\)
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	53                   	push   %ebx
- +[a-f0-9]+:	e8 18 00 00 00       	call   1ce <__x86.get_pc_thunk.bx>
- +[a-f0-9]+:	81 c3 36 11 00 00    	add    \$0x1136,%ebx
+ +[a-f0-9]+:	e8 18 00 00 00       	call   [0-9a-f]+ <__x86.get_pc_thunk.bx>
+ +[a-f0-9]+:	81 c3 ([0-9a-f]{2} ){4}[ 	]+add    \$0x[a-f0-9]+,%ebx
  +[a-f0-9]+:	83 ec 08             	sub    \$0x8,%esp
- +[a-f0-9]+:	e8 dc ff ff ff       	call   1a0 <bar2@plt>
- +[a-f0-9]+:	e8 c7 ff ff ff       	call   190 <bar1@plt>
+ +[a-f0-9]+:	e8 dc ff ff ff       	call   [a-f0-9]+ <bar2@plt>
+ +[a-f0-9]+:	e8 c7 ff ff ff       	call   [a-f0-9]+ <bar1@plt>
  +[a-f0-9]+:	83 c4 08             	add    \$0x8,%esp
  +[a-f0-9]+:	5b                   	pop    %ebx
  +[a-f0-9]+:	c3                   	ret    
 
-0+1ce <__x86.get_pc_thunk.bx>:
+[a-f0-9]+ <__x86.get_pc_thunk.bx>:
  +[a-f0-9]+:	8b 1c 24             	mov    \(%esp\),%ebx
  +[a-f0-9]+:	c3                   	ret    
 #pass
diff --git a/ld/testsuite/ld-i386/ibt-plt-2d.d b/ld/testsuite/ld-i386/ibt-plt-2d.d
index ec1a95ca4c..67260b8553 100644
--- a/ld/testsuite/ld-i386/ibt-plt-2d.d
+++ b/ld/testsuite/ld-i386/ibt-plt-2d.d
@@ -18,31 +18,31 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 0000001c 0000001c FDE cie=00000000 pc=000001b0..000001ce
-  DW_CFA_advance_loc: 1 to 000001b1
+0+18 0000001c 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_offset: r3 \(ebx\) at cfa-8
-  DW_CFA_advance_loc: 14 to 000001bf
+  DW_CFA_advance_loc: 14 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 13 to 000001cc
+  DW_CFA_advance_loc: 13 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
-  DW_CFA_advance_loc: 1 to 000001cd
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
   DW_CFA_restore: r3 \(ebx\)
   DW_CFA_def_cfa_offset: 4
 
-0+38 00000010 0000003c FDE cie=00000000 pc=000001ce..000001d2
+0+38 00000010 0000003c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+4c 00000020 00000050 FDE cie=00000000 pc=00000160..00000190
+0+4c 00000020 00000050 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 8
-  DW_CFA_advance_loc: 6 to 00000166
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 12
-  DW_CFA_advance_loc: 10 to 00000170
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg4 \(esp\): 4; DW_OP_breg8 \(eip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit2; DW_OP_shl; DW_OP_plus\)
 
-0+70 00000010 00000074 FDE cie=00000000 pc=00000190..000001b0
+0+70 00000010 00000074 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-i386/ibt-plt-3d.d b/ld/testsuite/ld-i386/ibt-plt-3d.d
index 35742ca2d9..42bd494c3e 100644
--- a/ld/testsuite/ld-i386/ibt-plt-3d.d
+++ b/ld/testsuite/ld-i386/ibt-plt-3d.d
@@ -18,31 +18,31 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 0000001c 0000001c FDE cie=00000000 pc=000001b0..000001ce
-  DW_CFA_advance_loc: 1 to 000001b1
+0+18 0000001c 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_offset: r3 \(ebx\) at cfa-8
-  DW_CFA_advance_loc: 14 to 000001bf
+  DW_CFA_advance_loc: 14 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 13 to 000001cc
+  DW_CFA_advance_loc: 13 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
-  DW_CFA_advance_loc: 1 to 000001cd
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
   DW_CFA_restore: r3 \(ebx\)
   DW_CFA_def_cfa_offset: 4
 
-0+38 00000010 0000003c FDE cie=00000000 pc=000001ce..000001d2
+0+38 00000010 0000003c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+4c 00000020 00000050 FDE cie=00000000 pc=00000160..00000190
+0+4c 00000020 00000050 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 8
-  DW_CFA_advance_loc: 6 to 00000166
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 12
-  DW_CFA_advance_loc: 10 to 00000170
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg4 \(esp\): 4; DW_OP_breg8 \(eip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit2; DW_OP_shl; DW_OP_plus\)
 
-0+70 00000010 00000074 FDE cie=00000000 pc=00000190..000001b0
+0+70 00000010 00000074 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-i386/pr23372c.d b/ld/testsuite/ld-i386/pr23372c.d
index d5bcc4d7b2..58803ab4b8 100644
--- a/ld/testsuite/ld-i386/pr23372c.d
+++ b/ld/testsuite/ld-i386/pr23372c.d
@@ -7,4 +7,4 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 
+      Properties: x86 ISA used: <None>
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d
index 21568c9cf8..f0a2b92c29 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 2002c8 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 2002d0 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 2002d8 <bar1>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 2002e0 <bar2>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  1a0 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   190 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-1.d b/ld/testsuite/ld-x86-64/ibt-plt-1.d
index 5a9dcb146e..a4064c6881 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-1.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-1.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+220 <.plt>:
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200410 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200418 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
 
 Disassembly of section .plt.sec:
 
-0+250 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200420 <bar1>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
-0+260 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200428 <bar2>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+270 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  260 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   250 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d
index e9f21b7252..50b8fb1b2a 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 2002c8 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 2002d0 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 2002d8 <bar1>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 2002e0 <bar2>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  1a0 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   190 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2c.d b/ld/testsuite/ld-x86-64/ibt-plt-2c.d
index fe28d89300..ce1885ece2 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-2c.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-2c.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+220 <.plt>:
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200410 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200418 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
 
 Disassembly of section .plt.sec:
 
-0+250 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200420 <bar1>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
-0+260 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200428 <bar2>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+270 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  260 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   250 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d
index 34e9f1cd12..8ece382c0b 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d
@@ -18,21 +18,21 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 00000014 0000001c FDE cie=00000000 pc=000001b0..000001c2
-  DW_CFA_advance_loc: 4 to 000001b4
+0+18 00000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 9 to 000001bd
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_nop
 
-0+30 00000020 00000034 FDE cie=00000000 pc=00000160..00000190
+0+30 00000020 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 6 to 00000166
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 24
-  DW_CFA_advance_loc: 10 to 00000170
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
 
-0+54 00000010 00000058 FDE cie=00000000 pc=00000190..000001b0
+0+54 00000010 00000058 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2d.d b/ld/testsuite/ld-x86-64/ibt-plt-2d.d
index 93cc26f3e7..dac86af946 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-2d.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-2d.d
@@ -18,25 +18,25 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000270..0000000000000282
-  DW_CFA_advance_loc: 4 to 0000000000000274
+0+18 0000000000000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 9 to 000000000000027d
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_nop
 
-0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000220..0000000000000250
+0+30 0000000000000024 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 6 to 0000000000000226
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 24
-  DW_CFA_advance_loc: 10 to 0000000000000230
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+58 0000000000000010 0000005c FDE cie=00000000 pc=0000000000000250..0000000000000270
+0+58 0000000000000010 0000005c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d
index 37f9182e68..c1c5ac41f7 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 2002c8 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 2002d0 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 2002d8 <bar1>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 2002e0 <bar2>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  1a0 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   190 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3c.d b/ld/testsuite/ld-x86-64/ibt-plt-3c.d
index 4122452510..fcb8cb9f37 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-3c.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-3c.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+220 <.plt>:
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200410 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200418 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
 
 Disassembly of section .plt.sec:
 
-0+250 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200420 <bar1>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
-0+260 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200428 <bar2>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+270 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  260 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   250 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d
index b6130a40e4..480a96a1c1 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d
@@ -18,21 +18,21 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 00000014 0000001c FDE cie=00000000 pc=000001b0..000001c2
-  DW_CFA_advance_loc: 4 to 000001b4
+0+18 00000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 9 to 000001bd
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_nop
 
-0+30 00000020 00000034 FDE cie=00000000 pc=00000160..00000190
+0+30 00000020 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 6 to 00000166
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 24
-  DW_CFA_advance_loc: 10 to 00000170
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
 
-0+54 00000010 00000058 FDE cie=00000000 pc=00000190..000001b0
+0+54 00000010 00000058 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3d.d b/ld/testsuite/ld-x86-64/ibt-plt-3d.d
index 2bf9e5de68..0278754da7 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-3d.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-3d.d
@@ -18,25 +18,25 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000270..0000000000000282
-  DW_CFA_advance_loc: 4 to 0000000000000274
+0+18 0000000000000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 9 to 000000000000027d
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_nop
 
-0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000220..0000000000000250
+0+30 0000000000000024 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 6 to 0000000000000226
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 24
-  DW_CFA_advance_loc: 10 to 0000000000000230
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+58 0000000000000010 0000005c FDE cie=00000000 pc=0000000000000250..0000000000000270
+0+58 0000000000000010 0000005c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-x86-64/pr23372c-x32.d b/ld/testsuite/ld-x86-64/pr23372c-x32.d
index efd6e84aa2..4d56e0d6b5 100644
--- a/ld/testsuite/ld-x86-64/pr23372c-x32.d
+++ b/ld/testsuite/ld-x86-64/pr23372c-x32.d
@@ -7,4 +7,4 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 
+      Properties: x86 ISA used: <None>
diff --git a/ld/testsuite/ld-x86-64/pr23372c.d b/ld/testsuite/ld-x86-64/pr23372c.d
index f56859a014..358a9b472a 100644
--- a/ld/testsuite/ld-x86-64/pr23372c.d
+++ b/ld/testsuite/ld-x86-64/pr23372c.d
@@ -7,4 +7,4 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 
+      Properties: x86 ISA used: <None>
diff --git a/ld/testsuite/ld-x86-64/property-x86-5a.s b/ld/testsuite/ld-x86-64/property-x86-5a.s
index 7b5b823e12..990c4683e6 100644
--- a/ld/testsuite/ld-x86-64/property-x86-5a.s
+++ b/ld/testsuite/ld-x86-64/property-x86-5a.s
@@ -41,8 +41,7 @@ _start:
 	.long 0xc0010000	/* pr_type.  */
 	.long 5f - 4f		/* pr_datasz.  */
 4:
-	/* GNU_PROPERTY_X86_UINT32_VALID */
-	.long 0x80000000
+	.long 0x0
 5:
 .ifdef __64_bit__
 	.p2align 3
diff --git a/ld/testsuite/ld-x86-64/property-x86-5b.s b/ld/testsuite/ld-x86-64/property-x86-5b.s
index 8857c11496..1f90dfc9f3 100644
--- a/ld/testsuite/ld-x86-64/property-x86-5b.s
+++ b/ld/testsuite/ld-x86-64/property-x86-5b.s
@@ -20,8 +20,7 @@
 	.long 0xc0010000	/* pr_type.  */
 	.long 5f - 4f		/* pr_datasz.  */
 4:
-	/* GNU_PROPERTY_X86_UINT32_VALID */
-	.long 0x80000000
+	.long 0x0
 5:
 .ifdef __64_bit__
 	.p2align 3
-- 
2.19.2


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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                           ` Cary Coutant
@ 2018-01-01  0:00                             ` Mark Wielaard
  2018-01-01  0:00                               ` Szabolcs Nagy
  2018-01-01  0:00                               ` H.J. Lu
  0 siblings, 2 replies; 21+ messages in thread
From: Mark Wielaard @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Cary Coutant
  Cc: H.J. Lu, Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

On Tue, Dec 11, 2018 at 09:58:30PM -0800, Cary Coutant wrote:
> > > I would strongly recommended to try harder to get consensus here.  I do
> > > not want to be a in a situation were we revise ABI again two years from
> > > now.
> >
> > That is my hope.  PT_GNU_PROPERTY is our consensus so far.
> 
> As you might expect, I support this new program header. Ideally, I'd
> have liked to replace the input SHT_NOTE sections with
> SHT_GNU_PROPERTY sections and dispense with all the note section
> overhead, but I'll take this as a compromise.

Why can't we switch to SHT_GNU_PROPERTY? My fear with combining
PT_GNU_PROPERTY with SHT_NOTE is that it will be even more confusing
for tools. You will get some allocated SHT_NOTEs in a PT_NOTE segment
and others in this new PT_GNU_PROPERTY segment (or worse, you get
multiple segments with different types covering the same ranges).

Also I thought there was still a question whether any or all
newly proposed property features and flags are actually needed
as loadable segments. There is a clear overlap with the GNU
Attributes (which are non-loadable). I would like to see consensus
first on the new property format/flags and which are and which
aren't needed as loadable properties at runtime.

Cheers,

Mark

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

* Re: RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property
  2018-01-01  0:00   ` H.J. Lu
@ 2018-01-01  0:00     ` Cary Coutant
  2018-01-01  0:00       ` H.J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Cary Coutant @ 2018-01-01  0:00 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

> > > 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.
> >
> > Okay.

Does this imply that the property notes in all pre-existing binaries
can't be trusted?

> > > 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.
> >
> > Surely this is a GAS bug?  Why not fix that bug?
>
> Linker removes GNU_PROPERTY_X86_ISA_1_USED when its value is empty.
> Maybe linker shouldn't do that.

Please explain how that answers Florian's question? You lost me.

What exactly are you saying the linker should not do? In your Aug. 10
proposal, ISA_1_USED is in the UINT32_OR_AND range, which specifically
says the bit should only be set in the output if *all* input files
contain the property (although it's unclear whether you meant "this
property is present in all relocatable input files" to mean a non-zero
property in all input files).

> > > 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.
> >
> > The alternative approach would be to switch to a new PT_ segment for
> > this because those aren't included in relocatable objects.  (Maybe it's
> > time for another approach.)
>
> PT_NOTE is used so that binaries with GNU properties are backward
> compatible with loaders which don't support GNU properties. They will
> run without any new features from GNU properties.

With both your Aug. 10 proposal and this one, you're throwing
compatibility out the window by saying the loader shouldn't trust
those old notes without VALID bits. Can't we use this opportunity to
just do it right? At this point, I don't really care if you keep on
using SHT_NOTE for the properties in relocatable files, but please,
let's use a proper PT_GNU_PROPERTY segment for executables. (Sorry, I
promised to yield to the consensus, but the design keeps getting more
complicated.)

-cary

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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                             ` Mark Wielaard
@ 2018-01-01  0:00                               ` Szabolcs Nagy
  2018-01-01  0:00                               ` H.J. Lu
  1 sibling, 0 replies; 21+ messages in thread
From: Szabolcs Nagy @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Mark Wielaard, Cary Coutant
  Cc: nd, H.J. Lu, Florian Weimer, Binutils, GNU C Library, gnu-gabi,
	x86-64-abi

On 12/12/2018 10:44, Mark Wielaard wrote:
> Also I thought there was still a question whether any or all
> newly proposed property features and flags are actually needed
> as loadable segments. There is a clear overlap with the GNU
> Attributes (which are non-loadable). I would like to see consensus
> first on the new property format/flags and which are and which
> aren't needed as loadable properties at runtime.

i think the list of properties that are needed at
runtime can be decided independently, since the
point of the property mechanism is to be extensible
and useful for future features.

i think it is clear that there are at least some
properties that elf loaders will need to check at
runtime, so we do need such a mechanism. (e.g.
PT_GNU_STACK is an existing example that could have
been implemented as a property).


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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                         ` H.J. Lu
@ 2018-01-01  0:00                           ` Cary Coutant
  2018-01-01  0:00                             ` Mark Wielaard
  0 siblings, 1 reply; 21+ messages in thread
From: Cary Coutant @ 2018-01-01  0:00 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

> > I would strongly recommended to try harder to get consensus here.  I do
> > not want to be a in a situation were we revise ABI again two years from
> > now.
>
> That is my hope.  PT_GNU_PROPERTY is our consensus so far.

As you might expect, I support this new program header. Ideally, I'd
have liked to replace the input SHT_NOTE sections with
SHT_GNU_PROPERTY sections and dispense with all the note section
overhead, but I'll take this as a compromise.

-cary

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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                       ` Florian Weimer
@ 2018-01-01  0:00                         ` H.J. Lu
  2018-01-01  0:00                           ` Cary Coutant
  0 siblings, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Florian Weimer
  Cc: Cary Coutant, Binutils, GNU C Library, gnu-gabi, x86-64-abi

On Tue, Dec 11, 2018 at 11:27:27AM +0100, Florian Weimer wrote:
> * H. J. Lu:
> 
> > diff --git a/ld/testsuite/ld-elf/pr23900-1b.d b/ld/testsuite/ld-elf/pr23900-1b.d
> > new file mode 100644
> > index 0000000000..e1555c29f6
> > --- /dev/null
> > +++ b/ld/testsuite/ld-elf/pr23900-1b.d
> > @@ -0,0 +1,14 @@
> > +#source: pr23900-1.s
> > +#ld:
> > +#readelf: -l --wide
> > +#target: *-*-linux* *-*-gnu* *-*-nacl*
> > +
> > +#...
> > +  GNU_PROPERTY .*
> > +#...
> > + +[0-9]+ +\.note\.gnu\.property 
> > +#...
> > + +[0-9]+ +\.note\.gnu\.property 
> > +#...
> > + +[0-9]+ +\.note\.gnu\.property 
> > +#...
> 
> Sholdn't there be a test that checks that the segment alignment is as
> expected?

I updated the patch to check for PT_GNU_PROPERTY segment alignment.

> 
> What happened to the earlier concerns that the presence of
> PT_GNU_PROPERTY will break some existing installations?

I checked both Linux kernel and glibc sources.  The unknown
PT_GNU_PROPERTY segment is ignored as it should be.
> 
> I would strongly recommended to try harder to get consensus here.  I do
> not want to be a in a situation were we revise ABI again two years from
> now.

That is my hope.  PT_GNU_PROPERTY is our consensus so far.

Here is the updated patch.  I will leave it for furher comments until
Friday, Dec. 14, 2018.

H.J.
---
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.  New linkers 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 older
linkers 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
are invalid.

GNU_PROPERTY_X86_UINT32_VALID was defined to address this issue such
that linker sets the bit 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 older linkers 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 PT_GNU_PROPERTY segment type:

 # define PT_GNU_PROPERTY (PT_LOOS + 0x474e553)

which covers .note.gnu.property section.
2. Remove GNU_PROPERTY_X86_UINT32_VALID.

bfd/

	PR ld/23900
	* elf.c (get_program_header_size): Add a PT_GNU_PROPERTY
	segment for NOTE_GNU_PROPERTY_SECTION_NAME.
	(_bfd_elf_map_sections_to_segments): Create a PT_GNU_PROPERTY
	segment for NOTE_GNU_PROPERTY_SECTION_NAME.
	* elfxx-x86.c (_bfd_elf_link_setup_gnu_properties): Don't set
	GNU_PROPERTY_X86_UINT32_VALID.

binutils/

	PR ld/23900
	* readelf.c (get_segment_type): Support PT_GNU_PROPERTY.
	(decode_x86_isa): Don't check GNU_PROPERTY_X86_UINT32_VALID.
	(decode_x86_feature_1): Likewise.
	(decode_x86_feature_2): Likewise.
	(print_gnu_property_note): Remove GNU_PROPERTY_X86_UINT32_VALID
	check.
	* testsuite/binutils-all/i386/empty.d: Updated.
	* testsuite/binutils-all/x86-64/empty-x32.d: Likewise.
	* testsuite/binutils-all/x86-64/empty.d: Likewise.
	* testsuite/binutils-all/i386/pr21231b.s: Change
	GNU_PROPERTY_X86_ISA_1_USED bits to 0x7fffffff.
	* testsuite/binutils-all/x86-64/pr21231b.s: Likewise.

gas/

	PR ld/23900
	* config/tc-i386.c (x86_cleanup): Don't set
	GNU_PROPERTY_X86_UINT32_VALID.
	* testsuite/gas/i386/property-1.s: Change
	GNU_PROPERTY_X86_ISA_1_USED bits to 0.

include/

	PR ld/23900
	* elf/common.h (PT_GNU_PROPERTY): New.
	(GNU_PROPERTY_X86_UINT32_VALID): Removed.

ld/

	PR ld/23900
	* testsuite/ld-elf/elf.exp: Run PR ld/23900 test.
	* testsuite/ld-elf/pr23900-1-32.rd: New file.
	* testsuite/ld-elf/pr23900-1-64.rd: Likewise.
	* testsuite/ld-elf/pr23900-1.d: Likewise.
	* testsuite/ld-elf/pr23900-1.s: Likewise.
	* testsuite/ld-elf/pr23900-2.s: Likewise.
	* testsuite/ld-elf/pr23900-2a.d: Likewise.
	* testsuite/ld-elf/pr23900-2b.d: Likewise.
	* testsuite/ld-i386/ibt-plt-1.d: Adjusted.
	* testsuite/ld-i386/ibt-plt-2c.d: Likewise.
	* testsuite/ld-i386/ibt-plt-2d.d: Likewise.
	* testsuite/ld-i386/ibt-plt-3d.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-1.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2d-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3c.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3d-x32.d: Likewise.
	* testsuite/ld-x86-64/ibt-plt-3d.d: Likewise.
	* testsuite/ld-i386/pr23372c.d: Expect <None>
	for GNU_PROPERTY_X86_ISA_1_USED.
	* testsuite/ld-x86-64/pr23372c-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372c.d: Likewise.
	* testsuite/ld-x86-64/pr23372d-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23372d.d: Likewise.
	* testsuite/ld-x86-64/property-x86-5a.s: Change
	GNU_PROPERTY_X86_ISA_1_USED bits to 0.
	* testsuite/ld-x86-64/property-x86-5b.s: Likewise.
---
 bfd/elf.c                                     | 26 ++++++++++++
 bfd/elfxx-x86.c                               | 10 ++---
 binutils/readelf.c                            | 21 +++-------
 binutils/testsuite/binutils-all/i386/empty.d  |  2 +-
 .../testsuite/binutils-all/i386/pr21231b.s    |  2 +-
 .../testsuite/binutils-all/x86-64/empty-x32.d |  2 +-
 .../testsuite/binutils-all/x86-64/empty.d     |  2 +-
 .../testsuite/binutils-all/x86-64/pr21231b.s  |  2 +-
 gas/config/tc-i386.c                          |  1 -
 gas/testsuite/gas/i386/property-1.s           |  3 +-
 include/elf/common.h                          |  4 +-
 ld/testsuite/ld-elf/elf.exp                   | 40 +++++++++++++++----
 ld/testsuite/ld-elf/pr23900-1-32.rd           | 14 +++++++
 ld/testsuite/ld-elf/pr23900-1-64.rd           | 14 +++++++
 ld/testsuite/ld-elf/pr23900-1.d               |  8 ++++
 ld/testsuite/ld-elf/pr23900-1.s               | 30 ++++++++++++++
 ld/testsuite/ld-elf/pr23900-2.s               | 32 +++++++++++++++
 ld/testsuite/ld-elf/pr23900-2a.d              |  9 +++++
 ld/testsuite/ld-elf/pr23900-2b.d              |  9 +++++
 ld/testsuite/ld-i386/ibt-plt-1.d              | 22 +++++-----
 ld/testsuite/ld-i386/ibt-plt-2c.d             | 22 +++++-----
 ld/testsuite/ld-i386/ibt-plt-2d.d             | 20 +++++-----
 ld/testsuite/ld-i386/ibt-plt-3d.d             | 20 +++++-----
 ld/testsuite/ld-i386/pr23372c.d               |  2 +-
 ld/testsuite/ld-x86-64/ibt-plt-1-x32.d        | 24 +++++------
 ld/testsuite/ld-x86-64/ibt-plt-1.d            | 24 +++++------
 ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d       | 24 +++++------
 ld/testsuite/ld-x86-64/ibt-plt-2c.d           | 24 +++++------
 ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d       | 14 +++----
 ld/testsuite/ld-x86-64/ibt-plt-2d.d           | 14 +++----
 ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d       | 24 +++++------
 ld/testsuite/ld-x86-64/ibt-plt-3c.d           | 24 +++++------
 ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d       | 14 +++----
 ld/testsuite/ld-x86-64/ibt-plt-3d.d           | 14 +++----
 ld/testsuite/ld-x86-64/pr23372c-x32.d         |  2 +-
 ld/testsuite/ld-x86-64/pr23372c.d             |  2 +-
 ld/testsuite/ld-x86-64/property-x86-5a.s      |  3 +-
 ld/testsuite/ld-x86-64/property-x86-5b.s      |  3 +-
 38 files changed, 336 insertions(+), 191 deletions(-)
 create mode 100644 ld/testsuite/ld-elf/pr23900-1-32.rd
 create mode 100644 ld/testsuite/ld-elf/pr23900-1-64.rd
 create mode 100644 ld/testsuite/ld-elf/pr23900-1.d
 create mode 100644 ld/testsuite/ld-elf/pr23900-1.s
 create mode 100644 ld/testsuite/ld-elf/pr23900-2.s
 create mode 100644 ld/testsuite/ld-elf/pr23900-2a.d
 create mode 100644 ld/testsuite/ld-elf/pr23900-2b.d

diff --git a/bfd/elf.c b/bfd/elf.c
index 79a76bea2f..688429b73e 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -4372,6 +4372,14 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info)
       ++segs;
     }
 
+  s = bfd_get_section_by_name (abfd,
+			       NOTE_GNU_PROPERTY_SECTION_NAME);
+  if (s != NULL && s->size != 0)
+    {
+      /* We need a PT_GNU_PROPERTY segment.  */
+      ++segs;
+    }
+
   for (s = abfd->sections; s != NULL; s = s->next)
     {
       if ((s->flags & SEC_LOAD) != 0
@@ -5055,6 +5063,24 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
 	      pm = &m->next;
 	    }
 
+      s = bfd_get_section_by_name (abfd,
+				   NOTE_GNU_PROPERTY_SECTION_NAME);
+      if (s != NULL && s->size != 0)
+	{
+	  amt = sizeof (struct elf_segment_map) + sizeof (asection *);
+	  m = bfd_zalloc (abfd, amt);
+	  if (m == NULL)
+	    goto error_return;
+	  m->next = NULL;
+	  m->p_type = PT_GNU_PROPERTY;
+	  m->count = 1;
+	  m->p_flags_valid = 1;
+	  m->sections[0] = s;
+	  m->p_flags = PF_R;
+	  *pm = m;
+	  pm = &m->next;
+	}
+
       /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME
 	 segment.  */
       eh_frame_hdr = elf_eh_frame_hdr (abfd);
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index eaa1a82b07..a58522deda 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -2944,8 +2944,9 @@ error_alignment:
 /* Fix up x86 GNU properties.  */
 
 void
-_bfd_x86_elf_link_fixup_gnu_properties (struct bfd_link_info *info,
-					elf_property_list **listp)
+_bfd_x86_elf_link_fixup_gnu_properties
+  (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+   elf_property_list **listp)
 {
   elf_property_list *p;
 
@@ -2973,11 +2974,6 @@ _bfd_x86_elf_link_fixup_gnu_properties (struct bfd_link_info *info,
 	      continue;
 	    }
 
-	  /* Mark x86-specific properties with X86_UINT32_VALID for
-	     non-relocatable output.  */
-	  if (!bfd_link_relocatable (info))
-	    p->property.u.number |= GNU_PROPERTY_X86_UINT32_VALID;
-
 	  listp = &p->next;
 	}
       else if (type > GNU_PROPERTY_HIPROC)
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 9969e46ea4..dd84a1996f 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -3930,6 +3930,7 @@ get_segment_type (Filedata * filedata, unsigned long p_type)
     case PT_GNU_EH_FRAME: return "GNU_EH_FRAME";
     case PT_GNU_STACK:	return "GNU_STACK";
     case PT_GNU_RELRO:  return "GNU_RELRO";
+    case PT_GNU_PROPERTY: return "GNU_PROPERTY";
 
     default:
       if (p_type >= PT_GNU_MBIND_LO && p_type <= PT_GNU_MBIND_HI)
@@ -17048,13 +17049,11 @@ decode_x86_compat_isa (unsigned int bitmask)
 static void
 decode_x86_isa (unsigned int bitmask)
 {
-  if (bitmask == GNU_PROPERTY_X86_UINT32_VALID)
+  if (!bitmask)
     {
       printf (_("<None>"));
       return;
     }
-  else
-    bitmask &= ~GNU_PROPERTY_X86_UINT32_VALID;
 
   while (bitmask)
     {
@@ -17147,13 +17146,11 @@ decode_x86_isa (unsigned int bitmask)
 static void
 decode_x86_feature_1 (unsigned int bitmask)
 {
-  if (bitmask == GNU_PROPERTY_X86_UINT32_VALID)
+  if (!bitmask)
     {
       printf (_("<None>"));
       return;
     }
-  else
-    bitmask &= ~GNU_PROPERTY_X86_UINT32_VALID;
 
   while (bitmask)
     {
@@ -17180,13 +17177,11 @@ decode_x86_feature_1 (unsigned int bitmask)
 static void
 decode_x86_feature_2 (unsigned int bitmask)
 {
-  if (bitmask == GNU_PROPERTY_X86_UINT32_VALID)
+  if (!bitmask)
     {
       printf (_("<None>"));
       return;
     }
-  else
-    bitmask &= ~GNU_PROPERTY_X86_UINT32_VALID;
 
   while (bitmask)
     {
@@ -17282,13 +17277,7 @@ print_gnu_property_note (Filedata * filedata, Elf_Internal_Note * pnote)
 	      unsigned int bitmask;
 
 	      if (datasz == 4)
-		{
-		  bitmask = byte_get (ptr, 4);
-		  if ((filedata->file_header.e_type == ET_EXEC
-		       || filedata->file_header.e_type == ET_DYN)
-		      && !(bitmask & GNU_PROPERTY_X86_UINT32_VALID))
-		    printf ("Invalid ");
-		}
+		bitmask = byte_get (ptr, 4);
 	      else
 		bitmask = 0;
 
diff --git a/binutils/testsuite/binutils-all/i386/empty.d b/binutils/testsuite/binutils-all/i386/empty.d
index 809280f73f..3c0e860a5e 100644
--- a/binutils/testsuite/binutils-all/i386/empty.d
+++ b/binutils/testsuite/binutils-all/i386/empty.d
@@ -6,7 +6,7 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 feature: 
+      Properties: x86 feature: <None>
   GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 ISA used: <None>
 	x86 feature used: x86
diff --git a/binutils/testsuite/binutils-all/i386/pr21231b.s b/binutils/testsuite/binutils-all/i386/pr21231b.s
index 793e282471..1fd2575e2a 100644
--- a/binutils/testsuite/binutils-all/i386/pr21231b.s
+++ b/binutils/testsuite/binutils-all/i386/pr21231b.s
@@ -22,7 +22,7 @@
 	.long 0xc0010000	/* pr_type.  */
 	.long 4f - 3f		/* pr_datasz.  */
 3:
-	.long -1
+	.long 0x7fffffff
 4:
 	.p2align 2
 	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
diff --git a/binutils/testsuite/binutils-all/x86-64/empty-x32.d b/binutils/testsuite/binutils-all/x86-64/empty-x32.d
index f6503746e8..32cc55e349 100644
--- a/binutils/testsuite/binutils-all/x86-64/empty-x32.d
+++ b/binutils/testsuite/binutils-all/x86-64/empty-x32.d
@@ -7,7 +7,7 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 feature: 
+      Properties: x86 feature: <None>
   GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 ISA used: <None>
 	x86 feature used: x86
diff --git a/binutils/testsuite/binutils-all/x86-64/empty.d b/binutils/testsuite/binutils-all/x86-64/empty.d
index 30a2ea4830..3cc52ba2e8 100644
--- a/binutils/testsuite/binutils-all/x86-64/empty.d
+++ b/binutils/testsuite/binutils-all/x86-64/empty.d
@@ -6,7 +6,7 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 feature: 
+      Properties: x86 feature: <None>
   GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 ISA used: <None>
 	x86 feature used: x86
diff --git a/binutils/testsuite/binutils-all/x86-64/pr21231b.s b/binutils/testsuite/binutils-all/x86-64/pr21231b.s
index add9227977..8fefebdb2f 100644
--- a/binutils/testsuite/binutils-all/x86-64/pr21231b.s
+++ b/binutils/testsuite/binutils-all/x86-64/pr21231b.s
@@ -22,7 +22,7 @@
 	.long 0xc0010000	/* pr_type.  */
 	.long 4f - 3f		/* pr_datasz.  */
 3:
-	.long -1
+	.long 0x7fffffff
 4:
 	.p2align 3
 	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 4fe9f0dda6..8e25e6c7a0 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7896,7 +7896,6 @@ x86_cleanup (void)
   if (!IS_ELF || !x86_used_note)
     return;
 
-  x86_isa_1_used |= GNU_PROPERTY_X86_UINT32_VALID;
   x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_X86;
 
   /* The .note.gnu.property section layout:
diff --git a/gas/testsuite/gas/i386/property-1.s b/gas/testsuite/gas/i386/property-1.s
index 8857c11496..4c29380447 100644
--- a/gas/testsuite/gas/i386/property-1.s
+++ b/gas/testsuite/gas/i386/property-1.s
@@ -20,8 +20,7 @@
 	.long 0xc0010000	/* pr_type.  */
 	.long 5f - 4f		/* pr_datasz.  */
 4:
-	/* GNU_PROPERTY_X86_UINT32_VALID */
-	.long 0x80000000
+	.long 0
 5:
 .ifdef __64_bit__
 	.p2align 3
diff --git a/include/elf/common.h b/include/elf/common.h
index da9ea036f4..1b3d713689 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -469,6 +469,7 @@
 #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
 #define PT_GNU_STACK	(PT_LOOS + 0x474e551) /* Stack flags */
 #define PT_GNU_RELRO	(PT_LOOS + 0x474e552) /* Read-only after relocation */
+#define PT_GNU_PROPERTY	(PT_LOOS + 0x474e553) /* GNU property */
 
 /* Mbind segments */
 #define PT_GNU_MBIND_NUM 4096
@@ -799,9 +800,6 @@
 #define GNU_PROPERTY_X86_FEATURE_2_USED \
   (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1)
 
-/* Set by linker to indicate that the property is valid.  */
-#define GNU_PROPERTY_X86_UINT32_VALID		(1U << 31)
-
 #define GNU_PROPERTY_X86_FEATURE_1_IBT		(1U << 0)
 #define GNU_PROPERTY_X86_FEATURE_1_SHSTK	(1U << 1)
 
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index 96ee01f9b1..3432f41720 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -75,8 +75,10 @@ run_ld_link_tests [list \
 
 if [is_elf64 tmpdir/symbol3w.a] {
     set ASFLAGS "$ASFLAGS --defsym ALIGN=3"
+    set pr23900_1_exp "pr23900-1-64.rd"
 } else {
     set ASFLAGS "$ASFLAGS --defsym ALIGN=2"
+    set pr23900_1_exp "pr23900-1-32.rd"
 }
 
 
@@ -144,14 +146,36 @@ if { [check_gc_sections_available] && ![istarget "v850-*-*"] } {
 if { [istarget *-*-*linux*]
      || [istarget *-*-nacl*]
      || [istarget *-*-gnu*] } {
-    run_ld_link_tests {
-	{"stack exec" "-z execstack" "" "" {stack.s}
-	    {{readelf {-Wl} stack-exec.rd}} "stack-exec.exe"}
-	{"stack noexec" "-z noexecstack" "" "" {stack.s}
-	    {{readelf {-Wl} stack-noexec.rd}} "stack-noexec.exe"}
-	{"stack size" "-z stack-size=0x123400" "" "" {stack.s}
-	    {{readelf {-Wl} stack-size.rd}} "stack-size.exe"}
-    }
+    run_ld_link_tests [list \
+	[list "stack exec" \
+	    "-z execstack" \
+	    "" \
+	    "" \
+	    {stack.s} \
+	    {{readelf {-Wl} stack-exec.rd}} \
+	    "stack-exec.exe"] \
+	[list "stack noexec" \
+	    "-z noexecstack" \
+	    "" \
+	    "" \
+	    {stack.s} \
+	    {{readelf {-Wl} stack-noexec.rd}} \
+	    "stack-noexec.exe"] \
+	[list "stack size" \
+	    "-z stack-size=0x123400" \
+	    "" \
+	    "" \
+	    {stack.s} \
+	    {{readelf {-Wl} stack-size.rd}} \
+	    "stack-size.exe"] \
+	[list "PT_GNU_PROPERTY alignment" \
+	    "" \
+	    "" \
+	    "" \
+	    {pr23900-1.s} \
+	    [list [list "readelf" {-Wl} $pr23900_1_exp]] \
+	    "pr23900-1.exe"] \
+	]
 }
 
 set LDFLAGS $old_ldflags
diff --git a/ld/testsuite/ld-elf/pr23900-1-32.rd b/ld/testsuite/ld-elf/pr23900-1-32.rd
new file mode 100644
index 0000000000..a21c0cbc1e
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-1-32.rd
@@ -0,0 +1,14 @@
+#source: pr23900-1.s
+#ld:
+#readelf: -l --wide
+#target: *-*-linux* *-*-gnu* *-*-nacl*
+
+#...
+  GNU_PROPERTY .* +0x4
+#...
+ +[0-9]+ +\.note\.gnu\.property 
+#...
+ +[0-9]+ +\.note\.gnu\.property 
+#...
+ +[0-9]+ +\.note\.gnu\.property 
+#...
diff --git a/ld/testsuite/ld-elf/pr23900-1-64.rd b/ld/testsuite/ld-elf/pr23900-1-64.rd
new file mode 100644
index 0000000000..8725515647
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-1-64.rd
@@ -0,0 +1,14 @@
+#source: pr23900-1.s
+#ld:
+#readelf: -l --wide
+#target: *-*-linux* *-*-gnu* *-*-nacl*
+
+#...
+  GNU_PROPERTY .* +0x8
+#...
+ +[0-9]+ +\.note\.gnu\.property 
+#...
+ +[0-9]+ +\.note\.gnu\.property 
+#...
+ +[0-9]+ +\.note\.gnu\.property 
+#...
diff --git a/ld/testsuite/ld-elf/pr23900-1.d b/ld/testsuite/ld-elf/pr23900-1.d
new file mode 100644
index 0000000000..2079c93f25
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-1.d
@@ -0,0 +1,8 @@
+#ld:
+#readelf: --notes --wide
+#target: *-*-linux* *-*-gnu* *-*-nacl*
+
+#...
+Displaying notes found in: \.note\.gnu\.property
+[ 	]+Owner[ 	]+Data size[ 	]+Description
+[ 	]+GNU[ 	]+0x0+..[ 	]+NT_GNU_PROPERTY_TYPE_0[ 	]+Properties: no copy on protected 
diff --git a/ld/testsuite/ld-elf/pr23900-1.s b/ld/testsuite/ld-elf/pr23900-1.s
new file mode 100644
index 0000000000..b0b54ed448
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-1.s
@@ -0,0 +1,30 @@
+	.text
+	.global start	/* Used by SH targets.  */
+start:
+	.global _start
+_start:
+	.global __start
+__start:
+	.global main	/* Used by HPPA targets.  */
+main:
+	.globl	_main	/* Used by LynxOS targets.  */
+_main:
+	.dc.a 0
+
+	.section .note.gnu.property, "a"
+	.p2align ALIGN
+	.dc.l .L1 - .L0		/* name length.  */
+	.dc.l .L3 - .L1		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.dc.l 5			/* note type.  */
+.L0:
+	.asciz "GNU"		/* vendor name.  */
+.L1:
+	.p2align ALIGN
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+	.dc.l 2			/* pr_type.  */
+	.dc.l .L5 - .L4		/* pr_datasz.  */
+.L4:
+.L5:
+	.p2align ALIGN
+.L3:
diff --git a/ld/testsuite/ld-elf/pr23900-2.s b/ld/testsuite/ld-elf/pr23900-2.s
new file mode 100644
index 0000000000..cfff675276
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-2.s
@@ -0,0 +1,32 @@
+	.text
+	.global start	/* Used by SH targets.  */
+start:
+	.global _start
+_start:
+	.global __start
+__start:
+	.global main	/* Used by HPPA targets.  */
+main:
+	.globl	_main	/* Used by LynxOS targets.  */
+_main:
+	.dc.a 0
+
+	/* NB: Deliberately incorrect section name.  Should be
+	       .note.gnu.property.  */
+	.section .note, "a"
+	.p2align ALIGN
+	.dc.l .L1 - .L0		/* name length.  */
+	.dc.l .L3 - .L1		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.dc.l 5			/* note type.  */
+.L0:
+	.asciz "GNU"		/* vendor name.  */
+.L1:
+	.p2align ALIGN
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+	.dc.l 2			/* pr_type.  */
+	.dc.l .L5 - .L4		/* pr_datasz.  */
+.L4:
+.L5:
+	.p2align ALIGN
+.L3:
diff --git a/ld/testsuite/ld-elf/pr23900-2a.d b/ld/testsuite/ld-elf/pr23900-2a.d
new file mode 100644
index 0000000000..836606d410
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-2a.d
@@ -0,0 +1,9 @@
+#source: pr23900-2.s
+#ld:
+#readelf: --notes --wide
+#target: *-*-linux* *-*-gnu* *-*-nacl*
+
+#...
+Displaying notes found in: \.note
+[ 	]+Owner[ 	]+Data size[ 	]+Description
+[ 	]+GNU[ 	]+0x0+..[ 	]+NT_GNU_PROPERTY_TYPE_0[ 	]+Properties: no copy on protected 
diff --git a/ld/testsuite/ld-elf/pr23900-2b.d b/ld/testsuite/ld-elf/pr23900-2b.d
new file mode 100644
index 0000000000..2aa04d760c
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23900-2b.d
@@ -0,0 +1,9 @@
+#source: pr23900-2.s
+#ld:
+#readelf: -l --wide
+#target: *-*-linux* *-*-gnu* *-*-nacl*
+
+#failif
+#...
+  GNU_PROPERTY .*
+#...
diff --git a/ld/testsuite/ld-i386/ibt-plt-1.d b/ld/testsuite/ld-i386/ibt-plt-1.d
index 2a8e0438a1..beccbf7b2b 100644
--- a/ld/testsuite/ld-i386/ibt-plt-1.d
+++ b/ld/testsuite/ld-i386/ibt-plt-1.d
@@ -7,45 +7,45 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
+[a-f0-9]+ <.plt>:
  +[a-f0-9]+:	ff b3 04 00 00 00    	pushl  0x4\(%ebx\)
  +[a-f0-9]+:	ff a3 08 00 00 00    	jmp    \*0x8\(%ebx\)
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%eax\)
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	68 00 00 00 00       	push   \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	68 08 00 00 00       	push   \$0x8
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	ff a3 0c 00 00 00    	jmp    \*0xc\(%ebx\)
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	ff a3 10 00 00 00    	jmp    \*0x10\(%ebx\)
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	53                   	push   %ebx
- +[a-f0-9]+:	e8 18 00 00 00       	call   1ce <__x86.get_pc_thunk.bx>
- +[a-f0-9]+:	81 c3 36 11 00 00    	add    \$0x1136,%ebx
+ +[a-f0-9]+:	e8 18 00 00 00       	call   [a-f0-9]+ <__x86.get_pc_thunk.bx>
+ +[a-f0-9]+:	81 c3 ([0-9a-f]{2} ){4}[ 	]+add    \$0x[a-f0-9]+,%ebx
  +[a-f0-9]+:	83 ec 08             	sub    \$0x8,%esp
- +[a-f0-9]+:	e8 dc ff ff ff       	call   1a0 <bar2@plt>
- +[a-f0-9]+:	e8 c7 ff ff ff       	call   190 <bar1@plt>
+ +[a-f0-9]+:	e8 dc ff ff ff       	call   [a-f0-9]+ <bar2@plt>
+ +[a-f0-9]+:	e8 c7 ff ff ff       	call   [a-f0-9]+ <bar1@plt>
  +[a-f0-9]+:	83 c4 08             	add    \$0x8,%esp
  +[a-f0-9]+:	5b                   	pop    %ebx
  +[a-f0-9]+:	c3                   	ret    
 
-0+1ce <__x86.get_pc_thunk.bx>:
+[a-f0-9]+ <__x86.get_pc_thunk.bx>:
  +[a-f0-9]+:	8b 1c 24             	mov    \(%esp\),%ebx
  +[a-f0-9]+:	c3                   	ret    
 #pass
diff --git a/ld/testsuite/ld-i386/ibt-plt-2c.d b/ld/testsuite/ld-i386/ibt-plt-2c.d
index d71f34d27c..7193034f78 100644
--- a/ld/testsuite/ld-i386/ibt-plt-2c.d
+++ b/ld/testsuite/ld-i386/ibt-plt-2c.d
@@ -8,45 +8,45 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
+[a-f0-9]+ <.plt>:
  +[a-f0-9]+:	ff b3 04 00 00 00    	pushl  0x4\(%ebx\)
  +[a-f0-9]+:	ff a3 08 00 00 00    	jmp    \*0x8\(%ebx\)
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%eax\)
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	68 00 00 00 00       	push   \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	68 08 00 00 00       	push   \$0x8
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmp    [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	ff a3 0c 00 00 00    	jmp    \*0xc\(%ebx\)
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fb          	endbr32 
  +[a-f0-9]+:	ff a3 10 00 00 00    	jmp    \*0x10\(%ebx\)
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	53                   	push   %ebx
- +[a-f0-9]+:	e8 18 00 00 00       	call   1ce <__x86.get_pc_thunk.bx>
- +[a-f0-9]+:	81 c3 36 11 00 00    	add    \$0x1136,%ebx
+ +[a-f0-9]+:	e8 18 00 00 00       	call   [0-9a-f]+ <__x86.get_pc_thunk.bx>
+ +[a-f0-9]+:	81 c3 ([0-9a-f]{2} ){4}[ 	]+add    \$0x[a-f0-9]+,%ebx
  +[a-f0-9]+:	83 ec 08             	sub    \$0x8,%esp
- +[a-f0-9]+:	e8 dc ff ff ff       	call   1a0 <bar2@plt>
- +[a-f0-9]+:	e8 c7 ff ff ff       	call   190 <bar1@plt>
+ +[a-f0-9]+:	e8 dc ff ff ff       	call   [a-f0-9]+ <bar2@plt>
+ +[a-f0-9]+:	e8 c7 ff ff ff       	call   [a-f0-9]+ <bar1@plt>
  +[a-f0-9]+:	83 c4 08             	add    \$0x8,%esp
  +[a-f0-9]+:	5b                   	pop    %ebx
  +[a-f0-9]+:	c3                   	ret    
 
-0+1ce <__x86.get_pc_thunk.bx>:
+[a-f0-9]+ <__x86.get_pc_thunk.bx>:
  +[a-f0-9]+:	8b 1c 24             	mov    \(%esp\),%ebx
  +[a-f0-9]+:	c3                   	ret    
 #pass
diff --git a/ld/testsuite/ld-i386/ibt-plt-2d.d b/ld/testsuite/ld-i386/ibt-plt-2d.d
index ec1a95ca4c..67260b8553 100644
--- a/ld/testsuite/ld-i386/ibt-plt-2d.d
+++ b/ld/testsuite/ld-i386/ibt-plt-2d.d
@@ -18,31 +18,31 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 0000001c 0000001c FDE cie=00000000 pc=000001b0..000001ce
-  DW_CFA_advance_loc: 1 to 000001b1
+0+18 0000001c 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_offset: r3 \(ebx\) at cfa-8
-  DW_CFA_advance_loc: 14 to 000001bf
+  DW_CFA_advance_loc: 14 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 13 to 000001cc
+  DW_CFA_advance_loc: 13 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
-  DW_CFA_advance_loc: 1 to 000001cd
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
   DW_CFA_restore: r3 \(ebx\)
   DW_CFA_def_cfa_offset: 4
 
-0+38 00000010 0000003c FDE cie=00000000 pc=000001ce..000001d2
+0+38 00000010 0000003c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+4c 00000020 00000050 FDE cie=00000000 pc=00000160..00000190
+0+4c 00000020 00000050 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 8
-  DW_CFA_advance_loc: 6 to 00000166
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 12
-  DW_CFA_advance_loc: 10 to 00000170
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg4 \(esp\): 4; DW_OP_breg8 \(eip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit2; DW_OP_shl; DW_OP_plus\)
 
-0+70 00000010 00000074 FDE cie=00000000 pc=00000190..000001b0
+0+70 00000010 00000074 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-i386/ibt-plt-3d.d b/ld/testsuite/ld-i386/ibt-plt-3d.d
index 35742ca2d9..42bd494c3e 100644
--- a/ld/testsuite/ld-i386/ibt-plt-3d.d
+++ b/ld/testsuite/ld-i386/ibt-plt-3d.d
@@ -18,31 +18,31 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 0000001c 0000001c FDE cie=00000000 pc=000001b0..000001ce
-  DW_CFA_advance_loc: 1 to 000001b1
+0+18 0000001c 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_offset: r3 \(ebx\) at cfa-8
-  DW_CFA_advance_loc: 14 to 000001bf
+  DW_CFA_advance_loc: 14 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 13 to 000001cc
+  DW_CFA_advance_loc: 13 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
-  DW_CFA_advance_loc: 1 to 000001cd
+  DW_CFA_advance_loc: 1 to [a-f0-9]+
   DW_CFA_restore: r3 \(ebx\)
   DW_CFA_def_cfa_offset: 4
 
-0+38 00000010 0000003c FDE cie=00000000 pc=000001ce..000001d2
+0+38 00000010 0000003c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+4c 00000020 00000050 FDE cie=00000000 pc=00000160..00000190
+0+4c 00000020 00000050 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 8
-  DW_CFA_advance_loc: 6 to 00000166
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 12
-  DW_CFA_advance_loc: 10 to 00000170
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg4 \(esp\): 4; DW_OP_breg8 \(eip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit2; DW_OP_shl; DW_OP_plus\)
 
-0+70 00000010 00000074 FDE cie=00000000 pc=00000190..000001b0
+0+70 00000010 00000074 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-i386/pr23372c.d b/ld/testsuite/ld-i386/pr23372c.d
index d5bcc4d7b2..58803ab4b8 100644
--- a/ld/testsuite/ld-i386/pr23372c.d
+++ b/ld/testsuite/ld-i386/pr23372c.d
@@ -7,4 +7,4 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 
+      Properties: x86 ISA used: <None>
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d
index 21568c9cf8..f0a2b92c29 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 2002c8 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 2002d0 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 2002d8 <bar1>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 2002e0 <bar2>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  1a0 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   190 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-1.d b/ld/testsuite/ld-x86-64/ibt-plt-1.d
index 5a9dcb146e..a4064c6881 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-1.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-1.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+220 <.plt>:
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200410 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200418 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
 
 Disassembly of section .plt.sec:
 
-0+250 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200420 <bar1>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
-0+260 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200428 <bar2>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+270 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  260 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   250 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d
index e9f21b7252..50b8fb1b2a 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 2002c8 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 2002d0 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 2002d8 <bar1>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 2002e0 <bar2>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  1a0 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   190 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2c.d b/ld/testsuite/ld-x86-64/ibt-plt-2c.d
index fe28d89300..ce1885ece2 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-2c.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-2c.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+220 <.plt>:
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200410 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200418 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
 
 Disassembly of section .plt.sec:
 
-0+250 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200420 <bar1>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
-0+260 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200428 <bar2>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+270 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  260 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   250 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d
index 34e9f1cd12..8ece382c0b 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d
@@ -18,21 +18,21 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 00000014 0000001c FDE cie=00000000 pc=000001b0..000001c2
-  DW_CFA_advance_loc: 4 to 000001b4
+0+18 00000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 9 to 000001bd
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_nop
 
-0+30 00000020 00000034 FDE cie=00000000 pc=00000160..00000190
+0+30 00000020 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 6 to 00000166
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 24
-  DW_CFA_advance_loc: 10 to 00000170
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
 
-0+54 00000010 00000058 FDE cie=00000000 pc=00000190..000001b0
+0+54 00000010 00000058 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2d.d b/ld/testsuite/ld-x86-64/ibt-plt-2d.d
index 93cc26f3e7..dac86af946 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-2d.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-2d.d
@@ -18,25 +18,25 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000270..0000000000000282
-  DW_CFA_advance_loc: 4 to 0000000000000274
+0+18 0000000000000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 9 to 000000000000027d
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_nop
 
-0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000220..0000000000000250
+0+30 0000000000000024 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 6 to 0000000000000226
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 24
-  DW_CFA_advance_loc: 10 to 0000000000000230
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+58 0000000000000010 0000005c FDE cie=00000000 pc=0000000000000250..0000000000000270
+0+58 0000000000000010 0000005c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d
index 37f9182e68..c1c5ac41f7 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+160 <.plt>:
- +[a-f0-9]+:	ff 35 62 01 20 00    	pushq  0x200162\(%rip\)        # 2002c8 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	ff 25 64 01 20 00    	jmpq   \*0x200164\(%rip\)        # 2002d0 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 e2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   160 <.plt>
+ +[a-f0-9]+:	e9 d2 ff ff ff       	jmpq   [a-f0-9]+ <.plt>
  +[a-f0-9]+:	66 90                	xchg   %ax,%ax
 
 Disassembly of section .plt.sec:
 
-0+190 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 3e 01 20 00    	jmpq   \*0x20013e\(%rip\)        # 2002d8 <bar1>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
-0+1a0 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	ff 25 36 01 20 00    	jmpq   \*0x200136\(%rip\)        # 2002e0 <bar2>
+ +[a-f0-9]+:	ff 25 ([0-9a-f]{2} ){4}[ 	]+jmpq   \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+1b0 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  1a0 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   190 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3c.d b/ld/testsuite/ld-x86-64/ibt-plt-3c.d
index 4122452510..fcb8cb9f37 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-3c.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-3c.d
@@ -8,36 +8,36 @@
 
 Disassembly of section .plt:
 
-0+220 <.plt>:
- +[a-f0-9]+:	ff 35 ea 01 20 00    	pushq  0x2001ea\(%rip\)        # 200410 <_GLOBAL_OFFSET_TABLE_\+0x8>
- +[a-f0-9]+:	f2 ff 25 eb 01 20 00 	bnd jmpq \*0x2001eb\(%rip\)        # 200418 <_GLOBAL_OFFSET_TABLE_\+0x10>
+[a-f0-9]+ <.plt>:
+ +[a-f0-9]+:	ff 35 ([0-9a-f]{2} ){4}[ 	]+pushq  0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x8>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <_GLOBAL_OFFSET_TABLE_\+0x10>
  +[a-f0-9]+:	0f 1f 00             	nopl   \(%rax\)
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 00 00 00 00       	pushq  \$0x0
- +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 e1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
  +[a-f0-9]+:	68 01 00 00 00       	pushq  \$0x1
- +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq 220 <.plt>
+ +[a-f0-9]+:	f2 e9 d1 ff ff ff    	bnd jmpq [a-f0-9]+ <.plt>
  +[a-f0-9]+:	90                   	nop
 
 Disassembly of section .plt.sec:
 
-0+250 <bar1@plt>:
+[a-f0-9]+ <bar1@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 c5 01 20 00 	bnd jmpq \*0x2001c5\(%rip\)        # 200420 <bar1>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar1>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
-0+260 <bar2@plt>:
+[a-f0-9]+ <bar2@plt>:
  +[a-f0-9]+:	f3 0f 1e fa          	endbr64 
- +[a-f0-9]+:	f2 ff 25 bd 01 20 00 	bnd jmpq \*0x2001bd\(%rip\)        # 200428 <bar2>
+ +[a-f0-9]+:	f2 ff 25 ([0-9a-f]{2} ){4}[ 	]+bnd jmpq \*0x[a-f0-9]+\(%rip\)        # [a-f0-9]+ <bar2>
  +[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%rax,%rax,1\)
 
 Disassembly of section .text:
 
-0+270 <foo>:
+[a-f0-9]+ <foo>:
  +[a-f0-9]+:	48 83 ec 08          	sub    \$0x8,%rsp
- +[a-f0-9]+:	e8 e7 ff ff ff       	callq  260 <bar2@plt>
+ +[a-f0-9]+:	e8 e7 ff ff ff       	callq  [a-f0-9]+ <bar2@plt>
  +[a-f0-9]+:	48 83 c4 08          	add    \$0x8,%rsp
- +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   250 <bar1@plt>
+ +[a-f0-9]+:	e9 ce ff ff ff       	jmpq   [a-f0-9]+ <bar1@plt>
 #pass
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d
index b6130a40e4..480a96a1c1 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d
@@ -18,21 +18,21 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 00000014 0000001c FDE cie=00000000 pc=000001b0..000001c2
-  DW_CFA_advance_loc: 4 to 000001b4
+0+18 00000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 9 to 000001bd
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_nop
 
-0+30 00000020 00000034 FDE cie=00000000 pc=00000160..00000190
+0+30 00000020 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 6 to 00000166
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 24
-  DW_CFA_advance_loc: 10 to 00000170
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
 
-0+54 00000010 00000058 FDE cie=00000000 pc=00000190..000001b0
+0+54 00000010 00000058 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3d.d b/ld/testsuite/ld-x86-64/ibt-plt-3d.d
index 2bf9e5de68..0278754da7 100644
--- a/ld/testsuite/ld-x86-64/ibt-plt-3d.d
+++ b/ld/testsuite/ld-x86-64/ibt-plt-3d.d
@@ -18,25 +18,25 @@ Contents of the .eh_frame section:
   DW_CFA_nop
   DW_CFA_nop
 
-0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000270..0000000000000282
-  DW_CFA_advance_loc: 4 to 0000000000000274
+0+18 0000000000000014 0000001c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
+  DW_CFA_advance_loc: 4 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 9 to 000000000000027d
+  DW_CFA_advance_loc: 9 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 8
   DW_CFA_nop
 
-0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000220..0000000000000250
+0+30 0000000000000024 00000034 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_def_cfa_offset: 16
-  DW_CFA_advance_loc: 6 to 0000000000000226
+  DW_CFA_advance_loc: 6 to [a-f0-9]+
   DW_CFA_def_cfa_offset: 24
-  DW_CFA_advance_loc: 10 to 0000000000000230
+  DW_CFA_advance_loc: 10 to [a-f0-9]+
   DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\)
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
 
-0+58 0000000000000010 0000005c FDE cie=00000000 pc=0000000000000250..0000000000000270
+0+58 0000000000000010 0000005c FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop
diff --git a/ld/testsuite/ld-x86-64/pr23372c-x32.d b/ld/testsuite/ld-x86-64/pr23372c-x32.d
index efd6e84aa2..4d56e0d6b5 100644
--- a/ld/testsuite/ld-x86-64/pr23372c-x32.d
+++ b/ld/testsuite/ld-x86-64/pr23372c-x32.d
@@ -7,4 +7,4 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 
+      Properties: x86 ISA used: <None>
diff --git a/ld/testsuite/ld-x86-64/pr23372c.d b/ld/testsuite/ld-x86-64/pr23372c.d
index f56859a014..358a9b472a 100644
--- a/ld/testsuite/ld-x86-64/pr23372c.d
+++ b/ld/testsuite/ld-x86-64/pr23372c.d
@@ -7,4 +7,4 @@
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 
+      Properties: x86 ISA used: <None>
diff --git a/ld/testsuite/ld-x86-64/property-x86-5a.s b/ld/testsuite/ld-x86-64/property-x86-5a.s
index 7b5b823e12..990c4683e6 100644
--- a/ld/testsuite/ld-x86-64/property-x86-5a.s
+++ b/ld/testsuite/ld-x86-64/property-x86-5a.s
@@ -41,8 +41,7 @@ _start:
 	.long 0xc0010000	/* pr_type.  */
 	.long 5f - 4f		/* pr_datasz.  */
 4:
-	/* GNU_PROPERTY_X86_UINT32_VALID */
-	.long 0x80000000
+	.long 0x0
 5:
 .ifdef __64_bit__
 	.p2align 3
diff --git a/ld/testsuite/ld-x86-64/property-x86-5b.s b/ld/testsuite/ld-x86-64/property-x86-5b.s
index 8857c11496..1f90dfc9f3 100644
--- a/ld/testsuite/ld-x86-64/property-x86-5b.s
+++ b/ld/testsuite/ld-x86-64/property-x86-5b.s
@@ -20,8 +20,7 @@
 	.long 0xc0010000	/* pr_type.  */
 	.long 5f - 4f		/* pr_datasz.  */
 4:
-	/* GNU_PROPERTY_X86_UINT32_VALID */
-	.long 0x80000000
+	.long 0x0
 5:
 .ifdef __64_bit__
 	.p2align 3
-- 
2.19.2

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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                             ` Mark Wielaard
  2018-01-01  0:00                               ` Szabolcs Nagy
@ 2018-01-01  0:00                               ` H.J. Lu
  2018-01-01  0:00                                 ` Cary Coutant
  1 sibling, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Mark Wielaard
  Cc: Cary Coutant, Florian Weimer, Binutils, GNU C Library, gnu-gabi,
	x86-64-abi

On Wed, Dec 12, 2018 at 2:44 AM Mark Wielaard <mark@klomp.org> wrote:
>
> On Tue, Dec 11, 2018 at 09:58:30PM -0800, Cary Coutant wrote:
> > > > I would strongly recommended to try harder to get consensus here.  I do
> > > > not want to be a in a situation were we revise ABI again two years from
> > > > now.
> > >
> > > That is my hope.  PT_GNU_PROPERTY is our consensus so far.
> >
> > As you might expect, I support this new program header. Ideally, I'd
> > have liked to replace the input SHT_NOTE sections with
> > SHT_GNU_PROPERTY sections and dispense with all the note section
> > overhead, but I'll take this as a compromise.
>
> Why can't we switch to SHT_GNU_PROPERTY? My fear with combining
> PT_GNU_PROPERTY with SHT_NOTE is that it will be even more confusing

There is no requirement for PT_XXX to have SHT_XXX, like PT_GNU_RELRO.

> for tools. You will get some allocated SHT_NOTEs in a PT_NOTE segment
> and others in this new PT_GNU_PROPERTY segment (or worse, you get
> multiple segments with different types covering the same ranges).

It is normal to have multiple segments to cover the same section,
like PT_TLS and PT_GNU_RELRO.

> Also I thought there was still a question whether any or all
> newly proposed property features and flags are actually needed
> as loadable segments. There is a clear overlap with the GNU
> Attributes (which are non-loadable). I would like to see consensus
> first on the new property format/flags and which are and which
> aren't needed as loadable properties at runtime.
>

Yes, they are needed in loadable segment.  That is the main motivation
for GNU program property,

-- 
H.J.

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

* Re: RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property
  2018-01-01  0:00         ` Florian Weimer
@ 2018-01-01  0:00           ` H.J. Lu
  2018-01-01  0:00             ` Cary Coutant
  0 siblings, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Florian Weimer
  Cc: Cary Coutant, Binutils, GNU C Library, gnu-gabi, x86-64-abi

On Tue, Nov 27, 2018 at 5:52 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> >> just do it right? At this point, I don't really care if you keep on
> >> using SHT_NOTE for the properties in relocatable files, but please,
> >> let's use a proper PT_GNU_PROPERTY segment for executables. (Sorry, I
> >> promised to yield to the consensus, but the design keeps getting more
> >> complicated.)
> >>
> >
> > PT_GNU_PROPERTY isn't compatible with existing loaders.  This needs
> > to be both forward and backward compatible.
>
> Which loaders?  The kernel?
>

Kernel, glibc, gdb, .....

-- 
H.J.

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

* Re: RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Florian Weimer @ 2018-01-01  0:00 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Binutils, GNU C Library, gnu-gabi, x86-64-abi

* H. J. Lu:

> 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.

Okay.

> 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.

Surely this is a GAS bug?  Why not fix that bug?

> 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.

The alternative approach would be to switch to a new PT_ segment for
this because those aren't included in relocatable objects.  (Maybe it's
time for another approach.)

Thanks,
Florian

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

* Re: RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property
  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
  0 siblings, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Cary Coutant
  Cc: Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

On Tue, Nov 27, 2018 at 11:25 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Tue, Nov 27, 2018 at 9:56 AM Cary Coutant <ccoutant@gmail.com> wrote:
> >
> > > > > PT_GNU_PROPERTY isn't compatible with existing loaders.  This needs
> > > > > to be both forward and backward compatible.
> > > >
> > > > Which loaders?  The kernel?
> > >
> > > Kernel, glibc, gdb, .....
> >
> > How is that any different from using PT_NOTE? Existing loaders don't
> > handle that either.
> >
> > If you're claiming that a new PT_ value in the program header table
> > will be rejected by existing loaders, that's a bug. It should be
> > fixed. The whole principle of ELF extensibility relies on that.
>
> Add PT_GNU_PROPERTY to cover .note.gnu.property section?

Like:

1. Add PT_GNU_PROPERTY segment type.

 # define PT_GNU_PROPERTY (PT_LOOS + 0x474e553)

which covers .note.gnu.property section.
2. Remove GNU_PROPERTY_X86_UINT32_VALID.

-- 
H.J.

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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                                 ` Cary Coutant
@ 2018-01-01  0:00                                   ` H.J. Lu
  0 siblings, 0 replies; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Cary Coutant
  Cc: Mark Wielaard, Florian Weimer, Binutils, GNU C Library, gnu-gabi,
	x86-64-abi

On Wed, Dec 12, 2018 at 8:12 AM Cary Coutant <ccoutant@gmail.com> wrote:
>
> > > > As you might expect, I support this new program header. Ideally, I'd
> > > > have liked to replace the input SHT_NOTE sections with
> > > > SHT_GNU_PROPERTY sections and dispense with all the note section
> > > > overhead, but I'll take this as a compromise.
> > >
> > > Why can't we switch to SHT_GNU_PROPERTY? My fear with combining
> > > PT_GNU_PROPERTY with SHT_NOTE is that it will be even more confusing
> >
> > There is no requirement for PT_XXX to have SHT_XXX, like PT_GNU_RELRO.
>
> But it is not normal for the linker to perform such special processing
> on an SHT_NOTE section. When a section requires special processing, it
> is customary to use a new section type. Otherwise, the linker has to
> resort to string matching on the section name. Section names in ELF
> are not supposed to have special meaning to the linker.

Good point.  It is too late now.

> > > Also I thought there was still a question whether any or all
> > > newly proposed property features and flags are actually needed
> > > as loadable segments. There is a clear overlap with the GNU
> > > Attributes (which are non-loadable). I would like to see consensus
> > > first on the new property format/flags and which are and which
> > > aren't needed as loadable properties at runtime.
> >
> > Yes, they are needed in loadable segment.  That is the main motivation
> > for GNU program property,
>
> The only properties required in a loadable segment are those that will
> be used by the loader. From what I can tell so far, the USED bits
> can't be used by the loader, so why can't they go in the GNU
> attributes section?

There are couple reasons:

1. GNU attributes section has a very different format and isn't
designed for loader.
2. X86 needs loadable properties.
3. X86 should use a uniform format for all properties.
4. USED bits can be useful.  For example, if AVX512 isn't marked as USED, OS
loader may optimize OS for this process with this info.


-- 
H.J.

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

* Re: RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section
  2018-01-01  0:00                     ` H.J. Lu
@ 2018-01-01  0:00                       ` H.J. Lu
  2018-01-01  0:00                       ` Florian Weimer
  1 sibling, 0 replies; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Cary Coutant
  Cc: Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

On Tue, Dec 4, 2018 at 5:57 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Wed, Nov 28, 2018 at 9:27 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Tue, Nov 27, 2018 at 3:59 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Tue, Nov 27, 2018 at 11:25 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >
> > > > On Tue, Nov 27, 2018 at 9:56 AM Cary Coutant <ccoutant@gmail.com> wrote:
> > > > >
> > > > > > > > PT_GNU_PROPERTY isn't compatible with existing loaders.  This needs
> > > > > > > > to be both forward and backward compatible.
> > > > > > >
> > > > > > > Which loaders?  The kernel?
> > > > > >
> > > > > > Kernel, glibc, gdb, .....
> > > > >
> > > > > How is that any different from using PT_NOTE? Existing loaders don't
> > > > > handle that either.
> > > > >
> > > > > If you're claiming that a new PT_ value in the program header table
> > > > > will be rejected by existing loaders, that's a bug. It should be
> > > > > fixed. The whole principle of ELF extensibility relies on that.
> > > >
> > > > Add PT_GNU_PROPERTY to cover .note.gnu.property section?
> > >
> > > Like:
> > >
> > > 1. Add PT_GNU_PROPERTY segment type.
> > >
> > >  # define PT_GNU_PROPERTY (PT_LOOS + 0x474e553)
> > >
> > > which covers .note.gnu.property section.
> > > 2. Remove GNU_PROPERTY_X86_UINT32_VALID.
> > >
> >
> > Here is a patch.  The updated pdf is at
> >
> > https://github.com/hjl-tools/linux-abi/wiki/linux-abi-draft.pdf
>
> Here is the patch to support PT_GNU_PROPERTY.   Any comments?
>

I am checking it in tomorrow.


-- 
H.J.

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

* Re: RFC: Linux gABI: Add a GNU_PROPERTY_BY_LINKER property
  2018-01-01  0:00             ` Cary Coutant
@ 2018-01-01  0:00               ` H.J. Lu
  2018-01-01  0:00                 ` H.J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: H.J. Lu @ 2018-01-01  0:00 UTC (permalink / raw)
  To: Cary Coutant
  Cc: Florian Weimer, Binutils, GNU C Library, gnu-gabi, x86-64-abi

On Tue, Nov 27, 2018 at 9:56 AM Cary Coutant <ccoutant@gmail.com> wrote:
>
> > > > PT_GNU_PROPERTY isn't compatible with existing loaders.  This needs
> > > > to be both forward and backward compatible.
> > >
> > > Which loaders?  The kernel?
> >
> > Kernel, glibc, gdb, .....
>
> How is that any different from using PT_NOTE? Existing loaders don't
> handle that either.
>
> If you're claiming that a new PT_ value in the program header table
> will be rejected by existing loaders, that's a bug. It should be
> fixed. The whole principle of ELF extensibility relies on that.

Add PT_GNU_PROPERTY to cover .note.gnu.property section?

-- 
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                       ` 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                               ` Szabolcs Nagy
2018-01-01  0:00                               ` H.J. Lu
2018-01-01  0:00                                 ` Cary Coutant
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).