diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-06-18 07:18:02 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-06-18 07:19:01 -0700 |
commit | 5a767724d7e4d8dfe70a82edceaeaa6d57ff2b84 (patch) | |
tree | 003f3353aeeda64e64ce591c1a70d66380f4195e /binutils | |
parent | 982c3a65ca5dbea8d6de3afd934f0a06fef54383 (diff) | |
download | gdb-5a767724d7e4d8dfe70a82edceaeaa6d57ff2b84.zip gdb-5a767724d7e4d8dfe70a82edceaeaa6d57ff2b84.tar.gz gdb-5a767724d7e4d8dfe70a82edceaeaa6d57ff2b84.tar.bz2 |
elf: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX
Implement GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX:
https://sourceware.org/pipermail/gnu-gabi/2021q1/000467.html
1. GNU_PROPERTY_UINT32_AND_LO..GNU_PROPERTY_UINT32_AND_HI
#define GNU_PROPERTY_UINT32_AND_LO 0xb0000000
#define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff
A bit in the output pr_data field is set only if it is set in all
relocatable input pr_data fields. If all bits in the the output
pr_data field are zero, this property should be removed from output.
If the bit is 1, all input relocatables have the feature. If the
bit is 0 or the property is missing, the info is unknown.
2. GNU_PROPERTY_UINT32_OR_LO..GNU_PROPERTY_UINT32_OR_HI
#define GNU_PROPERTY_UINT32_OR_LO 0xb0008000
#define GNU_PROPERTY_UINT32_OR_HI 0xb000ffff
A bit in the output pr_data field is set if it is set in any
relocatable input pr_data fields. If all bits in the the output
pr_data field are zero, this property should be removed from output.
If the bit is 1, some input relocatables have the feature. If the
bit is 0 or the property is missing, the info is unknown.
bfd/
* elf-properties.c (_bfd_elf_parse_gnu_properties): Handle
GNU_PROPERTY_UINT32_AND_LO, GNU_PROPERTY_UINT32_AND_HI,
GNU_PROPERTY_UINT32_OR_LO and GNU_PROPERTY_UINT32_OR_HI.
(elf_merge_gnu_properties): Likewise.
binutils/
* readelf.c (print_gnu_property_note): Handle
GNU_PROPERTY_UINT32_AND_LO, GNU_PROPERTY_UINT32_AND_HI,
GNU_PROPERTY_UINT32_OR_LO and GNU_PROPERTY_UINT32_OR_HI.
include/
* elf/common.h (GNU_PROPERTY_UINT32_AND_LO): New.
(GNU_PROPERTY_UINT32_AND_HI): Likewise.
(GNU_PROPERTY_UINT32_OR_LO): Likewise.
(GNU_PROPERTY_UINT32_OR_HI): Likewise.
ld/
* testsuite/ld-elf/property-and-1.d: New file.
* testsuite/ld-elf/property-and-1.s: Likewise.
* testsuite/ld-elf/property-and-2.d: Likewise.
* testsuite/ld-elf/property-and-2.s: Likewise.
* testsuite/ld-elf/property-and-3.d: Likewise.
* testsuite/ld-elf/property-and-3.s: Likewise.
* testsuite/ld-elf/property-and-4.d: Likewise.
* testsuite/ld-elf/property-and-empty.s: Likewise.
* testsuite/ld-elf/property-or-1.d: Likewise.
* testsuite/ld-elf/property-or-1.s: Likewise.
* testsuite/ld-elf/property-or-2.d: Likewise.
* testsuite/ld-elf/property-or-2.s: Likewise.
* testsuite/ld-elf/property-or-3.d: Likewise.
* testsuite/ld-elf/property-or-3.s: Likewise.
* testsuite/ld-elf/property-or-4.d: Likewise.
* testsuite/ld-elf/property-or-empty.s: Likewise.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/readelf.c | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index af73112..125dd2e 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2021-06-18 H.J. Lu <hongjiu.lu@intel.com> + + * readelf.c (print_gnu_property_note): Handle + GNU_PROPERTY_UINT32_AND_LO, GNU_PROPERTY_UINT32_AND_HI, + GNU_PROPERTY_UINT32_OR_LO and GNU_PROPERTY_UINT32_OR_HI. + 2021-06-15 Nick Clifton <nickc@redhat.com> * readelf.c (get_note_type): Add support for NT_GO_BUILDID. diff --git a/binutils/readelf.c b/binutils/readelf.c index 20100f1..f7c6432 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -19507,6 +19507,21 @@ print_gnu_property_note (Filedata * filedata, Elf_Internal_Note * pnote) goto next; default: + if ((type >= GNU_PROPERTY_UINT32_AND_LO + && type <= GNU_PROPERTY_UINT32_AND_HI) + || (type >= GNU_PROPERTY_UINT32_OR_LO + && type <= GNU_PROPERTY_UINT32_OR_HI)) + { + if (type <= GNU_PROPERTY_UINT32_AND_HI) + printf (_("UINT32_AND (%#x): "), type); + else + printf (_("UINT32_OR (%#x): "), type); + if (datasz != 4) + printf (_("<corrupt length: %#x> "), datasz); + else + printf ("%#x", (unsigned int) byte_get (ptr, 4)); + goto next; + } break; } } |