This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Commit: Add new GNU BUILD note type
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Thu, 16 Mar 2017 16:44:38 +0000
- Subject: Commit: Add new GNU BUILD note type
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=nickc at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7DADC8048A
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7DADC8048A
Hi Guys,
I am applying the patch below to add a new a type to the GNU BUILD
attributes. This type is used for recording the setting of the
-fshort-enums gcc command line option, so that conflicts in enum size
can be detected.
Cheers
Nick
include/ChangeLog
2017-03-16 Nick Clifton <nickc@redhat.com>
* elf/common.h (GNU_BUILD_ATTRIBUTE_SHORT_ENUM): New GNU BUILD
note type.
binutils/ChangeLog
2017-03-16 Nick Clifton <nickc@redhat.com>
* readelf.c (print_gnu_build_attribute_name): Add support for
GNU_BUILD_ATTRIBUTE_SHORT_ENUM.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 34781ae..5738fe5 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -16833,6 +16833,11 @@ print_gnu_build_attribute_name (Elf_Internal_Note * pnote)
expected_types = "*";
++ name;
break;
+ case GNU_BUILD_ATTRIBUTE_SHORT_ENUM:
+ text = _("<short enum>");
+ expected_types = "!+";
+ ++ name;
+ break;
default:
if (ISPRINT (* name))
diff --git a/include/elf/common.h b/include/elf/common.h
index 8888a55..65877fe 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -682,6 +682,7 @@
#define GNU_BUILD_ATTRIBUTE_TOOL 5
#define GNU_BUILD_ATTRIBUTE_ABI 6
#define GNU_BUILD_ATTRIBUTE_PIC 7
+#define GNU_BUILD_ATTRIBUTE_SHORT_ENUM 8
#define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property"
#define GNU_BUILD_ATTRS_SECTION_NAME ".gnu.build.attributes"