read_3_bytes assumes little-endian data, but in fact it depends on the
BFD. This patch rewrites this function to use bfd_get_24 instead.
2020-11-04 Tom Tromey <tromey@adacore.com>
* dwarf2/leb.h (read_3_bytes): Use bfd_get_24.
+2020-11-04 Tom Tromey <tromey@adacore.com>
+
+ * dwarf2/leb.h (read_3_bytes): Use bfd_get_24.
+
2020-11-02 Tom Tromey <tromey@adacore.com>
* Makefile.in (ALL_64_TARGET_OBS): Add amd64-ravenscar-thread.o.
static inline unsigned int
read_3_bytes (bfd *abfd, const gdb_byte *buf)
{
- unsigned int result = 0;
- for (int i = 0; i < 3; ++i)
- {
- unsigned char byte = bfd_get_8 (abfd, buf);
- buf++;
- result |= ((unsigned int) byte << (i * 8));
- }
- return result;
+ return bfd_get_24 (abfd, buf);
}
static inline unsigned int