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.
This commit is contained in:
H.J. Lu
2021-06-17 12:35:18 -07:00
parent ce8fea3651
commit 6320fd00dc
4 changed files with 78 additions and 0 deletions

View File

@@ -792,6 +792,13 @@
#define GNU_PROPERTY_UINT32_OR_LO 0xb0008000
#define GNU_PROPERTY_UINT32_OR_HI 0xb000ffff
/* The needed properties by the object file. */
#define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO
/* Set if the object file requires canonical function pointers and
cannot be used with copy relocation. */
#define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS (1U << 0)
/* Processor-specific semantics, lo */
#define GNU_PROPERTY_LOPROC 0xc0000000
/* Processor-specific semantics, hi */