libctf, binutils: fix big-endian libctf archive opening
authorNick Alcock <nick.alcock@oracle.com>
Wed, 1 Jul 2020 19:10:17 +0000 (20:10 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 22 Jul 2020 17:05:32 +0000 (18:05 +0100)
commit4533ed564d6953990210ba63c091009380ec2327
treefad001573ba50372fe46ab53d9079895636e6519
parent62cdd7b18fc41a29b6bc22b4bbba0bff55434628
libctf, binutils: fix big-endian libctf archive opening

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.
libctf/ChangeLog
libctf/ctf-archive.c