From: Mark Wielaard Date: Tue, 11 Nov 2014 13:10:04 +0000 (+0100) Subject: libdw: Fix dwarf_getsrclines.c 32bit compile error. X-Git-Tag: elfutils-0.161~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09086238f39daab4060d0e5f39f89820a0771d8c;p=thirdparty%2Felfutils.git libdw: Fix dwarf_getsrclines.c 32bit compile error. __libdw_getsrclines should have been marked as internal_function in both libdwP.h and dwarf_getsrclines.c. Do address_size comparison as uint8_t to avoid signedness warning. Signed-off-by: Mark Wielaard --- diff --git a/libdw/ChangeLog b/libdw/ChangeLog index d5796e8e3..58736a6b8 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,9 @@ +2014-11-11 Mark Wielaard + + * dwarf_getsrclines.c (read_srclines): Do address_size comparison + explicitly as uint8_t. + (__libdw_getsrclines): Add internal_function to declaration. + 2014-09-10 Petr Machata * dwarf_macro_getparamcnt.c: New file. diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c index 4bb19c2e0..15881e8ea 100644 --- a/libdw/dwarf_getsrclines.c +++ b/libdw/dwarf_getsrclines.c @@ -428,7 +428,7 @@ read_srclines (Dwarf *dbg, apporiate for the target machine. We use the address size field from the CU header. */ op_index = 0; - if (unlikely (lineendp - linep < address_size)) + if (unlikely (lineendp - linep < (uint8_t) address_size)) goto invalid_data; if (__libdw_read_address_inc (dbg, IDX_debug_line, &linep, address_size, &addr)) @@ -730,6 +730,7 @@ files_lines_compare (const void *p1, const void *p2) } int +internal_function __libdw_getsrclines (Dwarf *dbg, Dwarf_Off debug_line_offset, const char *comp_dir, unsigned address_size, Dwarf_Lines **linesp, Dwarf_Files **filesp)