elf: Add GNU_PROPERTY_1_NEEDED
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 17 Jun 2021 19:35:18 +0000 (12:35 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 9 Jul 2021 01:11:53 +0000 (18:11 -0700)
commit6320fd00dc374f74658c7e4b7dffbe1d71723284
tree95d9ca4603d3b066d511280d66ee384062c52853
parentce8fea3651a6050d5089b6d90068733f4cb9f686
elf: Add GNU_PROPERTY_1_NEEDED

Add GNU_PROPERTY_1_NEEDED:

 #define GNU_PROPERTY_1_NEEDED      GNU_PROPERTY_UINT32_OR_LO

to indicate the needed properties by the object file.

Add GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS:

 #define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS  (1U << 0)

to indicate that the object file requires canonical function pointers and
cannot be used with copy relocation.

binutils/

* readelf.c (decode_1_needed): New.
(print_gnu_property_note): Handle GNU_PROPERTY_1_NEEDED.

include/

* elf/common.h (GNU_PROPERTY_1_NEEDED): New.
(GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS): Likewise.

ld/

* testsuite/ld-elf/property-1_needed-1a.d: New file.
* testsuite/ld-elf/property-1_needed-1.s: Likewise.
binutils/readelf.c
include/elf/common.h
ld/testsuite/ld-elf/property-1_needed-1.s [new file with mode: 0644]
ld/testsuite/ld-elf/property-1_needed-1a.d [new file with mode: 0644]