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:06:12 +0000 (19:06 -0400)
commit8d48beb93387cf8e35da8adf2ea62bed40d194c7
tree01784b597a6d75e67b0f48dc1ecf5dad7967f4a2
parent03fb60893cf59e16f26d1f6d84b8a4921bbe8eae
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.024546 seconds and 4 git commands to generate.