Hi, Since addr2line uses elf_getscn and gelf_getshdr it should link with libelf explicitly. $(libelf) is defined differently depending on makefile variables earlier. The other programs explicitly link against it.
This just happens to work with GNU ld currently, since it will silently try to resolve dependencies through other linked in libraries, but it is an problem with other elf linkers, like GNU gold, that don't link against libraries implicitly. Cheers, Mark
>From 8fdcbe0cdcc886fb9e0e846de63b9359443e95c6 Mon Sep 17 00:00:00 2001 From: Mark Wielaard <[email protected]> Date: Sat, 25 Jul 2009 21:12:10 +0200 Subject: [PATCH] addr2line depends on libelf. addr2line uses elf_getscn and gelf_getshdr, so should link against libelf. --- src/ChangeLog | 4 ++++ src/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 93edfde..88e0c11 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2009-07-25 Mark Wielaard <[email protected]> + + * Makefile.am (addr2line_LDADD): Add $(libelf). + 2009-07-24 Roland McGrath <[email protected]> * readelf.c (print_block): New function. diff --git a/src/Makefile.am b/src/Makefile.am index c644a06..059bdda 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -124,7 +124,7 @@ endif ld_LDFLAGS = -rdynamic elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap) -addr2line_LDADD = $(libdw) $(libmudflap) +addr2line_LDADD = $(libelf) $(libdw) $(libmudflap) elfcmp_LDADD = $(libebl) $(libelf) $(libmudflap) -ldl objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl ranlib_LDADD = libar.a $(libelf) $(libeu) $(libmudflap) -- 1.6.2.5
_______________________________________________ elfutils-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/elfutils-devel
