binutils: readelf: support CTF dicts with non-native-endian symtabs
authorNick Alcock <nick.alcock@oracle.com>
Mon, 23 Nov 2020 21:30:24 +0000 (21:30 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 25 Nov 2020 19:11:35 +0000 (19:11 +0000)
Now we have a way to tell libctf what the endianness of the symtab is,
get readelf to use it.  (objdump doesn't need to do so, nor does ld,
because they both use BFD-aware mechanisms to open CTF dicts, so libctf
can automatically figure the symtab endianness out.)

binutils/ChangeLog
2020-11-23  Nick Alcock  <nick.alcock@oracle.com>

* readelf.c (dump_section_as_ctf): Call ctf_arc_symsect_endianness.

binutils/ChangeLog
binutils/readelf.c

index 84853986e670ac1d934a28e505b7cede843eea66..e03c892b0cebe5005eeeaa04f2a94473afa6157f 100644 (file)
@@ -1,3 +1,7 @@
+2020-11-23  Nick Alcock  <nick.alcock@oracle.com>
+
+       * readelf.c (dump_section_as_ctf): Call ctf_arc_symsect_endianness.
+
 2020-11-25  Alan Modra  <amodra@gmail.com>
 
        * testsuite/binutils-all/nm.exp (ifunc): xfail more targets.
index e4d96bb9b34aac0a48434082df8c247c3c03ba64..57e0f1de4591893384c345a40bd8d1976abf429e 100644 (file)
@@ -14758,6 +14758,9 @@ dump_section_as_ctf (Elf_Internal_Shdr * section, Filedata * filedata)
       goto fail;
     }
 
+  ctf_arc_symsect_endianness (ctfa, filedata->file_header.e_ident[EI_DATA]
+                             != ELFDATA2MSB);
+
   if (parentdata)
     {
       if ((parenta = ctf_arc_bufopen (&parentsect, symsectp, strsectp,