The recent commit "libctf, binutils: support CTF archives like objdump"
broke opening of CTF archives on big-endian platforms.
This didn't affect anyone much before now because the linker never
emitted CTF archives because it wasn't detecting ambiguous types
properly: now it does, and this bug becomes obvious.
Fix trivial.
libctf/
* ctf-archive.c (ctf_arc_bufopen): Endian-swap the archive magic
number if needed.
+2020-07-22 Nick Alcock <nick.alcock@oracle.com>
+
+ * ctf-archive.c (ctf_arc_bufopen): Endian-swap the archive magic
+ number if needed.
+
2020-07-22 Nick Alcock <nick.alcock@oracle.com>
* ctf-impl.h (ctf_list_splice): New.
ctf_file_t *fp = NULL;
if (ctfsect->cts_size > sizeof (uint64_t) &&
- ((*(uint64_t *) ctfsect->cts_data) == CTFA_MAGIC))
+ (le64toh ((*(uint64_t *) ctfsect->cts_data)) == CTFA_MAGIC))
{
/* The archive is mmappable, so this operation is trivial.