This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH, ARM/ld]Linker should return with error if failed to merge arch attribute
- From: Nicholas Clifton <nickc at redhat dot com>
- To: Terry Guo <flameroc at gmail dot com>, binutils at sourceware dot org
- Date: Tue, 16 Sep 2014 13:12:57 +0100
- Subject: Re: [PATCH, ARM/ld]Linker should return with error if failed to merge arch attribute
- Authentication-results: sourceware.org; auth=none
- References: <CAGbRaL5Z0iGviNi9aE8vixs7sDFemR4AyjnrMbb2c5Tb7eM-KA at mail dot gmail dot com>
Hi Terry,
bfd/ChangeLog:
2014-09-15 Terry Guo<terry.guo@arm.com>
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Return false if
failed to merge.
ld/testsuite/ChangeLog:
2014-09-15 Terry Guo<terry.guo@arm.com>
* ld-arm/attr-merge-arch-2.d: New test case.
* ld-arm/attr-merge-arch-2a.s: New test case source file.
* ld-arm/attr-merge-arch-2b.s: Likewise.
* ld-arm/arm-elf.exp: Run new test case.
Approved and applied.
Note - I added a small patch to readelf to fix the seg-fault as well:
Cheers
Nick
binutils/ChangeLog
2014-09-16 Nick Clifton <nickc@redhat.com>
* readelf.c (display_arm_attribute): Use unsigned int type for
tag, val and type variables.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index ef3a68d..d9c12cc 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -11548,10 +11548,10 @@ display_tag_value (int tag,
/* ARM EABI attributes section. */
typedef struct
{
- int tag;
+ unsigned int tag;
const char * name;
/* 0 = special, 1 = string, 2 = uleb123, > 0x80 == table lookup. */
- int type;
+ unsigned int type;
const char ** table;
} arm_attr_public_tag;
@@ -11669,12 +11669,12 @@ static unsigned char *
display_arm_attribute (unsigned char * p,
const unsigned char * const end)
{
- int tag;
+ unsigned int tag;
unsigned int len;
- int val;
+ unsigned int val;
arm_attr_public_tag * attr;
unsigned i;
- int type;
+ unsigned int type;
tag = read_uleb128 (p, &len, end);
p += len;