rtld-elf: add some debug print statements

The byte-order independent code has been reported to fail on powerpc64.
Add some more debug statements to help identify the parametrs used and
to verify the correct operation of the byte-swap macros used..
This commit is contained in:
Stefan Eßer 2024-03-21 16:31:49 +01:00
parent 36de8bb226
commit 173953182a

View file

@ -2109,6 +2109,11 @@ gethints(bool nostdlib)
return (NULL);
}
is_le = /*le32toh(1) == 1 || */ hdr.magic == ELFHINTS_MAGIC;
dbg("host byte-order: %s-endian", le32toh(1) == 1 ? "little" : "big");
dbg("hints file byte-order: %s-endian", is_le ? "little" : "big");
dbg("verify swap macros: le32toh(0x12345678) == %#010x, "
"be32toh(0x12345678) == %#010x",
le32toh(0x12345678), be32toh(0x12345678));
magic = COND_SWAP(hdr.magic);
version = COND_SWAP(hdr.version);
strtab = COND_SWAP(hdr.strtab);