aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2010-11-02 14:36:39 +0000
committerJoseph Myers <joseph@codesourcery.com>2010-11-02 14:36:39 +0000
commit877791769e23126090bab077d41f4d6221a23045 (patch)
treed2bb3fc25263f3ff4f0567b690aa6a453b263da2 /binutils
parent34734a010beee3b56b382dc93249b6cd27c9a373 (diff)
downloadfsf-binutils-gdb-877791769e23126090bab077d41f4d6221a23045.zip
fsf-binutils-gdb-877791769e23126090bab077d41f4d6221a23045.tar.gz
fsf-binutils-gdb-877791769e23126090bab077d41f4d6221a23045.tar.bz2
bfd:
* elf32-tic6x.c (elf32_tic6x_obj_attrs_arg_type): Except for Tag_ABI_compatibility, treat odd tags as strings and even ones as integers. (elf32_tic6x_obj_attrs_order, elf32_tic6x_tag_to_array_alignment, elf32_tic6x_array_alignment_to_tag): New. (elf32_tic6x_merge_attributes): Handle more attributes. Set type for merged attributes. (elf_backend_obj_attrs_order): Define. binutils: * readelf.c (display_tic6x_attribute): Handle more attributes. gas: * config/tc-tic6x.c (OPTION_MPID, OPTION_MPIC, OPTION_MNO_PIC): New enum values. (md_longopts): Add options mpid, mpic and mno-pic. (tic6x_pid_type, tic6x_pid, tic6x_pic, tic6x_pid_type_table, tic6x_pid_types, tic6x_use_pid): New. (md_parse_option): Handle new options. (md_show_usage): Output help text for new options. (tic6x_set_attributes): Set PID and PIC attributes. * doc/as.texinfo: Document -mpid=, -mpic and -mno-pic. * doc/c-tic6x.texi (TIC6X Options): Likewise. gas/testsuite: * gas/tic6x/attr-array-directive-1.d, gas/tic6x/attr-array-directive-1.s, gas/tic6x/attr-array-directive-2.d, gas/tic6x/attr-array-directive-2.s, gas/tic6x/attr-array-directive-3.d, gas/tic6x/attr-array-directive-3.s, gas/tic6x/attr-array-directive-4.d, gas/tic6x/attr-array-directive-4.s, gas/tic6x/attr-conformance-directive-1.d, gas/tic6x/attr-conformance-directive-1.s, gas/tic6x/attr-conformance-directive-2.d, gas/tic6x/attr-conformance-directive-2.s, gas/tic6x/attr-pic-directive-1.d, gas/tic6x/attr-pic-directive-1.s, gas/tic6x/attr-pic-directive-2.d, gas/tic6x/attr-pic-directive-2.s, gas/tic6x/attr-pic-opts-mno-pic.d, gas/tic6x/attr-pic-opts-mpic.d, gas/tic6x/attr-pid-directive-1.d, gas/tic6x/attr-pid-directive-1.s, gas/tic6x/attr-pid-directive-2.d, gas/tic6x/attr-pid-directive-2.s, gas/tic6x/attr-pid-opts-mpid-far.d, gas/tic6x/attr-pid-opts-mpid-near.d, gas/tic6x/attr-pid-opts-mpid-no.d, gas/tic6x/attr-stack-directive-1.d, gas/tic6x/attr-stack-directive-1.s, gas/tic6x/attr-stack-directive-2.d, gas/tic6x/attr-stack-directive-2.s, gas/tic6x/attr-wchar-directive-1.d, gas/tic6x/attr-wchar-directive-1.s, gas/tic6x/attr-wchar-directive-2.d, gas/tic6x/attr-wchar-directive-2.s: New tests. include/elf: * tic6x-attrs.h (Tag_ABI_wchar_t, Tag_ABI_stack_align_needed, Tag_ABI_stack_align_preserved, Tag_ABI_PID, Tag_ABI_PIC, Tag_ABI_array_object_alignment, Tag_ABI_array_object_align_expected, Tag_ABI_conformance): Define. ld/testsuite: * ld-tic6x/attr-array-16-16.d, ld-tic6x/attr-array-16-4.d, ld-tic6x/attr-array-16-416.d, ld-tic6x/attr-array-16-48.d, ld-tic6x/attr-array-16-8.d, ld-tic6x/attr-array-16-816.d, ld-tic6x/attr-array-16.s, ld-tic6x/attr-array-4-16.d, ld-tic6x/attr-array-4-4.d, ld-tic6x/attr-array-4-416.d, ld-tic6x/attr-array-4-48.d, ld-tic6x/attr-array-4-8.d, ld-tic6x/attr-array-4-816.d, ld-tic6x/attr-array-4.s, ld-tic6x/attr-array-416-16.d, ld-tic6x/attr-array-416-4.d, ld-tic6x/attr-array-416-416.d, ld-tic6x/attr-array-416-48.d, ld-tic6x/attr-array-416-8.d, ld-tic6x/attr-array-416-816.d, ld-tic6x/attr-array-416.s, ld-tic6x/attr-array-48-16.d, ld-tic6x/attr-array-48-4.d, ld-tic6x/attr-array-48-416.d, ld-tic6x/attr-array-48-48.d, ld-tic6x/attr-array-48-8.d, ld-tic6x/attr-array-48-816.d, ld-tic6x/attr-array-48.s, ld-tic6x/attr-array-8-16.d, ld-tic6x/attr-array-8-4.d, ld-tic6x/attr-array-8-416.d, ld-tic6x/attr-array-8-48.d, ld-tic6x/attr-array-8-8.d, ld-tic6x/attr-array-8-816.d, ld-tic6x/attr-array-8.s, ld-tic6x/attr-array-816-16.d, ld-tic6x/attr-array-816-4.d, ld-tic6x/attr-array-816-416.d, ld-tic6x/attr-array-816-48.d, ld-tic6x/attr-array-816-8.d, ld-tic6x/attr-array-816-816.d, ld-tic6x/attr-array-816.s, ld-tic6x/attr-conformance-10-10.d, ld-tic6x/attr-conformance-10-11.d, ld-tic6x/attr-conformance-10-none.d, ld-tic6x/attr-conformance-10.s, ld-tic6x/attr-conformance-11-10.d, ld-tic6x/attr-conformance-11-11.d, ld-tic6x/attr-conformance-11-none.d, ld-tic6x/attr-conformance-11.s, ld-tic6x/attr-conformance-none-10.d, ld-tic6x/attr-conformance-none-11.d, ld-tic6x/attr-conformance-none-none.d, ld-tic6x/attr-conformance-none.s, ld-tic6x/attr-pic-0.s, ld-tic6x/attr-pic-00.d, ld-tic6x/attr-pic-01.d, ld-tic6x/attr-pic-1.s, ld-tic6x/attr-pic-10.d, ld-tic6x/attr-pic-11.d, ld-tic6x/attr-pid-0.s, ld-tic6x/attr-pid-00.d, ld-tic6x/attr-pid-01.d, ld-tic6x/attr-pid-02.d, ld-tic6x/attr-pid-1.s, ld-tic6x/attr-pid-10.d, ld-tic6x/attr-pid-11.d, ld-tic6x/attr-pid-12.d, ld-tic6x/attr-pid-2.s, ld-tic6x/attr-pid-20.d, ld-tic6x/attr-pid-21.d, ld-tic6x/attr-pid-22.d, ld-tic6x/attr-stack-16-16.d, ld-tic6x/attr-stack-16-8.d, ld-tic6x/attr-stack-16-816.d, ld-tic6x/attr-stack-16.s, ld-tic6x/attr-stack-8-16.d, ld-tic6x/attr-stack-8-8.d, ld-tic6x/attr-stack-8-816.d, ld-tic6x/attr-stack-8.s, ld-tic6x/attr-stack-816-16.d, ld-tic6x/attr-stack-816-8.d, ld-tic6x/attr-stack-816-816.d, ld-tic6x/attr-stack-816.s, ld-tic6x/attr-wchar-0.s, ld-tic6x/attr-wchar-00.d, ld-tic6x/attr-wchar-01.d, ld-tic6x/attr-wchar-02.d, ld-tic6x/attr-wchar-1.s, ld-tic6x/attr-wchar-10.d, ld-tic6x/attr-wchar-11.d, ld-tic6x/attr-wchar-12.d, ld-tic6x/attr-wchar-2.s, ld-tic6x/attr-wchar-20.d, ld-tic6x/attr-wchar-21.d, ld-tic6x/attr-wchar-22.d: New tests.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog4
-rw-r--r--binutils/readelf.c160
2 files changed, 159 insertions, 5 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 1640443..8acf57e 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-02 Joseph Myers <joseph@codesourcery.com>
+
+ * readelf.c (display_tic6x_attribute): Handle more attributes.
+
2010-10-30 Kai Tietz <kai.tietz@onevision.com>
* dlltool.c (scan_drectve_symbols): Allow quoted strings for -export
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 44feac4..0ed5c7c 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -10804,6 +10804,63 @@ display_tic6x_attribute (unsigned char * p)
}
return p;
+ case Tag_ABI_wchar_t:
+ val = read_uleb128 (p, &len);
+ p += len;
+ printf (" Tag_ABI_wchar_t: ");
+ switch (val)
+ {
+ case 0:
+ printf (_("Not used\n"));
+ break;
+ case 1:
+ printf (_("2 bytes\n"));
+ break;
+ case 2:
+ printf (_("4 bytes\n"));
+ break;
+ default:
+ printf ("??? (%d)\n", val);
+ break;
+ }
+ return p;
+
+ case Tag_ABI_stack_align_needed:
+ val = read_uleb128 (p, &len);
+ p += len;
+ printf (" Tag_ABI_stack_align_needed: ");
+ switch (val)
+ {
+ case 0:
+ printf (_("8-byte\n"));
+ break;
+ case 1:
+ printf (_("16-byte\n"));
+ break;
+ default:
+ printf ("??? (%d)\n", val);
+ break;
+ }
+ return p;
+
+ case Tag_ABI_stack_align_preserved:
+ val = read_uleb128 (p, &len);
+ p += len;
+ printf (" Tag_ABI_stack_align_preserved: ");
+ switch (val)
+ {
+ case 0:
+ printf (_("8-byte\n"));
+ break;
+ case 1:
+ printf (_("16-byte\n"));
+ break;
+ default:
+ printf ("??? (%d)\n", val);
+ break;
+ }
+ return p;
+
case Tag_ABI_DSBT:
val = read_uleb128 (p, &len);
p += len;
@@ -10822,6 +10879,87 @@ display_tic6x_attribute (unsigned char * p)
}
return p;
+ case Tag_ABI_PID:
+ val = read_uleb128 (p, &len);
+ p += len;
+ printf (" Tag_ABI_PID: ");
+ switch (val)
+ {
+ case 0:
+ printf (_("Data addressing position-dependent\n"));
+ break;
+ case 1:
+ printf (_("Data addressing position-independent, GOT near DP\n"));
+ break;
+ case 2:
+ printf (_("Data addressing position-independent, GOT far from DP\n"));
+ break;
+ default:
+ printf ("??? (%d)\n", val);
+ break;
+ }
+ return p;
+
+ case Tag_ABI_PIC:
+ val = read_uleb128 (p, &len);
+ p += len;
+ printf (" Tag_ABI_PIC: ");
+ switch (val)
+ {
+ case 0:
+ printf (_("Code addressing position-dependent\n"));
+ break;
+ case 1:
+ printf (_("Code addressing position-independent\n"));
+ break;
+ default:
+ printf ("??? (%d)\n", val);
+ break;
+ }
+ return p;
+
+ case Tag_ABI_array_object_alignment:
+ val = read_uleb128 (p, &len);
+ p += len;
+ printf (" Tag_ABI_array_object_alignment: ");
+ switch (val)
+ {
+ case 0:
+ printf (_("8-byte\n"));
+ break;
+ case 1:
+ printf (_("4-byte\n"));
+ break;
+ case 2:
+ printf (_("16-byte\n"));
+ break;
+ default:
+ printf ("??? (%d)\n", val);
+ break;
+ }
+ return p;
+
+ case Tag_ABI_array_object_align_expected:
+ val = read_uleb128 (p, &len);
+ p += len;
+ printf (" Tag_ABI_array_object_align_expected: ");
+ switch (val)
+ {
+ case 0:
+ printf (_("8-byte\n"));
+ break;
+ case 1:
+ printf (_("4-byte\n"));
+ break;
+ case 2:
+ printf (_("16-byte\n"));
+ break;
+ default:
+ printf ("??? (%d)\n", val);
+ break;
+ }
+ return p;
+
case Tag_ABI_compatibility:
val = read_uleb128 (p, &len);
p += len;
@@ -10829,15 +10967,27 @@ display_tic6x_attribute (unsigned char * p)
printf (_("flag = %d, vendor = %s\n"), val, p);
p += strlen ((char *) p) + 1;
return p;
+
+ case Tag_ABI_conformance:
+ printf (" Tag_ABI_conformance: ");
+ printf ("\"%s\"\n", p);
+ p += strlen ((char *) p) + 1;
+ return p;
}
printf (" Tag_unknown_%d: ", tag);
- /* No general documentation of handling unknown attributes, treat as
- ULEB128 for now. */
- val = read_uleb128 (p, &len);
- p += len;
- printf ("%d (0x%x)\n", val, val);
+ if (tag & 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;
}