diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-05-08 15:28:09 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-05-08 15:55:12 +0200 |
commit | 3695a1ba8dcd16459e0f35b74e88dbef48d21861 (patch) | |
tree | 674d0dc13f0065f81e7f672e81fc09b42405656d /libdwfl | |
parent | 9f6ffdc1b75fd69ecda219c9e9f1b2551f542b26 (diff) | |
parent | 6358858c4d65e8fb12a112198ee1d4bcab0be876 (diff) |
Merge tag 'elfutils-0.169'QtCreator4.5.1QtCreator4.5.0-rc1QtCreator4.5.0QtCreator4.4.1QtCreator4.4.0-rc1QtCreator4.4.0-beta1QtCreator4.4.04.54.4
Conflicts:
ChangeLog
backends/ChangeLog
config/ChangeLog
lib/ChangeLog
libasm/ChangeLog
libcpu/ChangeLog
libdw/ChangeLog
libdwfl/ChangeLog
libdwfl/derelocate.c
libdwfl/linux-kernel-modules.c
libebl/ChangeLog
libelf/ChangeLog
src/ChangeLog
tests/ChangeLog
Change-Id: I3b7ced947c6498290aaae27443985b84531f0bcd
Diffstat (limited to 'libdwfl')
-rw-r--r-- | libdwfl/ChangeLog | 26 | ||||
-rw-r--r-- | libdwfl/derelocate.c | 19 | ||||
-rw-r--r-- | libdwfl/linux-kernel-modules.c | 3 |
3 files changed, 27 insertions, 21 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 517ba216..d6aa70e5 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -30,14 +30,22 @@ * linux-kernel-modules.c: Don't include system.h. +2017-02-22 Ulf Hermann <ulf.hermann@qt.io> + + * dwfl_error.c: If we don't have a strerror_r returning a char*, + output a less useful message in case of a system error. + 2017-04-20 Ulf Hermann <ulf.hermann@qt.io> + Mark Wielaard <mark@klomp.org> * derelocate.c (compare_secrefs): Compare by end address and then by - name if start addresses are equal. + section number if addresses are equal. 2017-04-20 Ulf Hermann <ulf.hermann@qt.io> + Mark Wielaard <mark@klomp.org> - * elf-from-memory.c: Explicitly cast phnum to size_t. + * linux-kernel-modules.c: Always return NULL from kernel_release() on + non-linux systems and set errno to ENOTSUP. 2017-04-20 Ulf Hermann <ulf.hermann@qt.io> @@ -99,17 +107,16 @@ 2017-04-20 Ulf Hermann <ulf.hermann@qt.io> - * linux-kernel-modules.c: Always return NULL from kernel_release() on - non-linux systems. + * libdwfl.h: Use __const_attribute__. 2017-04-20 Ulf Hermann <ulf.hermann@qt.io> - * dwfl_module_getdwarf.c: Check shnum for 0 before subtracting from - it. + * elf-from-memory.c: Explicitly cast phnum to size_t. 2017-04-20 Ulf Hermann <ulf.hermann@qt.io> - * libdwfl.h: Use __const_attribute__. + * dwfl_module_getdwarf.c: Check shnum for 0 before subtracting from + it. 2017-04-20 Ulf Hermann <ulf.hermann@qt.io> @@ -128,11 +135,6 @@ the note name data is the empty string. (dwfl_core_file_attach): Likewise. -2017-02-22 Ulf Hermann <ulf.hermann@qt.io> - - * dwfl_error.c: If we don't have a strerror_r returning a char*, - output a less useful message in case of a system error. - 2017-02-15 Ulf Hermann <ulf.hermann@qt.io> * linux-kernel-modules.c: Include system.h. diff --git a/libdwfl/derelocate.c b/libdwfl/derelocate.c index 8d965af9..2f80b20f 100644 --- a/libdwfl/derelocate.c +++ b/libdwfl/derelocate.c @@ -57,22 +57,23 @@ struct secref static int compare_secrefs (const void *a, const void *b) { - struct secref const *p1 = *(struct secref *const *)a; - struct secref const *p2 = *(struct secref *const *)b; + struct secref *const *p1 = a; + struct secref *const *p2 = b; /* No signed difference calculation is correct here, since the terms are unsigned and could be more than INT64_MAX apart. */ - if (p1->start < p2->start) + if ((*p1)->start < (*p2)->start) return -1; - if (p1->start > p2->start) + if ((*p1)->start > (*p2)->start) return 1; - if (p1->end < p2->end) + + if ((*p1)->end < (*p2)->end) return -1; - if (p1->end > p2->end) + if ((*p1)->end > (*p2)->end) return 1; - if (p1->name == NULL) - return p2->name == NULL ? 0 : -1; - return p2->name == NULL ? 1 : strcmp(p1->name, p2->name); + + /* Same start/end, then just compare which section came first. */ + return elf_ndxscn ((*p1)->scn) - elf_ndxscn ((*p2)->scn); } static int diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c index bd963d32..4b454d37 100644 --- a/libdwfl/linux-kernel-modules.c +++ b/libdwfl/linux-kernel-modules.c @@ -163,6 +163,9 @@ kernel_release (void) return NULL; return utsname.release; #else + /* Used for finding the running linux kernel, which isn't supported + on non-linux kernel systems. */ + errno = ENOTSUP; return NULL; #endif } |