Fix: flt.lttng-utils.debug-info: build id note section non-native byte order
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 3 May 2019 16:39:59 +0000 (12:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 23:04:44 +0000 (19:04 -0400)
commitaf54bd1801ea51b6710a9926ed12b82fc43cc944
tree3597f189e1d2c83b0befcca9eac1f7e38fee50f4
parent282b829b5df579f26e8506f58b6e7cb2a7a928b8
Fix: flt.lttng-utils.debug-info: build id note section non-native byte order

Issue
=====
The build id comparison code does not take into account that the target
binary file could be compiled for another architecture and thus could be
of a different byte order. This makes the build_id testcase fail on
PowerPC. The artefacts used for this testcase are compiled on x86 and
are thus in little endian as opposed to PowerPC's big endianness.

Solution
========
Parse the Elf file to extract the endianness of the binary and use that
information to change the byte order of the note section if necessary.

Drawbacks
=========
None.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Id5d761832f9463b38ea0452da36053e885929aa9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1246
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
plugins/lttng-utils/debug-info/bin-info.c
plugins/lttng-utils/debug-info/bin-info.h
This page took 0.02573 seconds and 4 git commands to generate.