aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2007-06-30 00:03:40 +0000
committerJoseph Myers <joseph@codesourcery.com>2007-06-30 00:03:40 +0000
commit34c8bcbae2e6ea0752c1ebe6e1282cc74a821957 (patch)
tree0681992a1200b9024ba536d903485f4157840067 /binutils
parent89ebe6973393e6e0721c0c131c4abf2661fbe56c (diff)
downloadbinutils-34c8bcbae2e6ea0752c1ebe6e1282cc74a821957.zip
binutils-34c8bcbae2e6ea0752c1ebe6e1282cc74a821957.tar.gz
binutils-34c8bcbae2e6ea0752c1ebe6e1282cc74a821957.tar.bz2
bfd:
* elf32-ppc.c (ppc_elf_merge_obj_attributes): New. (ppc_elf_merge_private_bfd_data): Call it. binutils: * readelf.c (display_power_gnu_attribute, process_power_specific): New. (process_arch_specific): Call process_power_specific. include/elf: * ppc.h (Tag_GNU_Power_ABI_FP): Define. ld/testsuite: * ld-powerpc/attr-gnu-4-0.s, ld-powerpc/attr-gnu-4-00.d, ld-powerpc/attr-gnu-4-01.d, ld-powerpc/attr-gnu-4-02.d, ld-powerpc/attr-gnu-4-1.s, ld-powerpc/attr-gnu-4-10.d, ld-powerpc/attr-gnu-4-11.d, ld-powerpc/attr-gnu-4-12.d, ld-powerpc/attr-gnu-4-13.d, ld-powerpc/attr-gnu-4-2.s, ld-powerpc/attr-gnu-4-20.d, ld-powerpc/attr-gnu-4-21.d, ld-powerpc/attr-gnu-4-22.d, ld-powerpc/attr-gnu-4-3.s, ld-powerpc/attr-gnu-4-31.d: New. * ld-powerpc/powerpc.exp: Run these new tests.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/readelf.c61
2 files changed, 67 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 76e0b68..4096ba2 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,11 @@
2007-06-29 Joseph Myers <joseph@codesourcery.com>
+ * readelf.c (display_power_gnu_attribute, process_power_specific):
+ New.
+ (process_arch_specific): Call process_power_specific.
+
+2007-06-29 Joseph Myers <joseph@codesourcery.com>
+
* readelf.c (display_mips_gnu_attribute): New.
(process_mips_specific): Call process_attributes.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index c20fcd6..ab41e28 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -8347,6 +8347,57 @@ display_gnu_attribute (unsigned char *p,
}
static unsigned char *
+display_power_gnu_attribute (unsigned char *p, int tag)
+{
+ int type;
+ unsigned int len;
+ int val;
+
+ if (tag == Tag_GNU_Power_ABI_FP)
+ {
+ val = read_uleb128 (p, &len);
+ p += len;
+ printf (" Tag_GNU_Power_ABI_FP: ");
+ switch (val)
+ {
+ case 0:
+ printf ("Hard or soft float\n");
+ break;
+ case 1:
+ printf ("Hard float\n");
+ break;
+ case 2:
+ printf ("Soft float\n");
+ break;
+ default:
+ printf ("??? (%d)\n", val);
+ break;
+ }
+ return p;
+ }
+
+ if (tag & 1)
+ type = 1; /* String. */
+ else
+ type = 2; /* uleb128. */
+ printf (" Tag_unknown_%d: ", tag);
+
+ if (type == 1)
+ {
+ printf ("\"%s\"\n", p);
+ p += strlen ((char *)p) + 1;
+ }
+ else
+ {
+ val = read_uleb128 (p, &len);
+ p += len;
+ printf ("%d (0x%x)\n", val, val);
+ }
+
+ return p;
+}
+
+static unsigned char *
display_mips_gnu_attribute (unsigned char *p, int tag)
{
int type;
@@ -8540,6 +8591,13 @@ process_arm_specific (FILE *file)
}
static int
+process_power_specific (FILE *file)
+{
+ return process_attributes (file, NULL, SHT_GNU_ATTRIBUTES, NULL,
+ display_power_gnu_attribute);
+}
+
+static int
process_mips_specific (FILE *file)
{
Elf_Internal_Dyn *entry;
@@ -9317,6 +9375,9 @@ process_arch_specific (FILE *file)
case EM_MIPS_RS3_LE:
return process_mips_specific (file);
break;
+ case EM_PPC:
+ return process_power_specific (file);
+ break;
default:
break;
}