From 3d08506936d16401aade168de0c95646b3f54a94 Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Sun, 12 Feb 2012 19:53:38 -0800 Subject: [PATCH] Fix undefined symbol: _Uelf64_valid_object Without this change, we end up building libunwind-${arch}.a with missing symbols. Signed-off-by: Jan Kratochvil --- src/elfxx.c | 13 ------------- src/elfxx.h | 13 ++++++++++++- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/elfxx.c b/src/elfxx.c index 7ed44bac..68c303a8 100644 --- a/src/elfxx.c +++ b/src/elfxx.c @@ -29,19 +29,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "libunwind_i.h" -HIDDEN int -elf_w (valid_object) (struct elf_image *ei) -{ - if (ei->size <= EI_VERSION) - return 0; - - return (memcmp (ei->image, ELFMAG, SELFMAG) == 0 - && ((uint8_t *) ei->image)[EI_CLASS] == ELF_CLASS - && ((uint8_t *) ei->image)[EI_VERSION] != EV_NONE - && ((uint8_t *) ei->image)[EI_VERSION] <= EV_CURRENT); -} - - static int elf_w (lookup_symbol) (unw_addr_space_t as, unw_word_t ip, struct elf_image *ei, diff --git a/src/elfxx.h b/src/elfxx.h index a85cc681..f53eae78 100644 --- a/src/elfxx.h +++ b/src/elfxx.h @@ -43,12 +43,23 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "libunwind_i.h" -extern int elf_w (valid_object) (struct elf_image *ei); extern int elf_w (get_proc_name) (unw_addr_space_t as, pid_t pid, unw_word_t ip, char *buf, size_t len, unw_word_t *offp); +static inline int +elf_w (valid_object) (struct elf_image *ei) +{ + if (ei->size <= EI_VERSION) + return 0; + + return (memcmp (ei->image, ELFMAG, SELFMAG) == 0 + && ((uint8_t *) ei->image)[EI_CLASS] == ELF_CLASS + && ((uint8_t *) ei->image)[EI_VERSION] != EV_NONE + && ((uint8_t *) ei->image)[EI_VERSION] <= EV_CURRENT); +} + static inline int elf_map_image (struct elf_image *ei, const char *path) {