diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-26 01:52:19 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-26 01:52:19 +0200 |
commit | c4a346002bc06046bc51910a7ade3a0c650c3d34 (patch) | |
tree | a1a8a29e423fce067a784ec89068532637bebc8e /tools | |
parent | Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff) | |
parent | objtool: Allow building with older libelf (diff) | |
download | linux-c4a346002bc06046bc51910a7ade3a0c650c3d34.tar.xz linux-c4a346002bc06046bc51910a7ade3a0c650c3d34.zip |
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool build fix from Ingo Molnar:
"An libtool fix for older libelf versions"
* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool: Allow building with older libelf
Diffstat (limited to 'tools')
-rw-r--r-- | tools/objtool/Makefile | 4 | ||||
-rw-r--r-- | tools/objtool/elf.h | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 6765c7e949f3..f094f3c4ed84 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -30,6 +30,10 @@ INCLUDES := -I$(srctree)/tools/include CFLAGS += -Wall -Werror $(EXTRA_WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES) LDFLAGS += -lelf $(LIBSUBCMD) +# Allow old libelf to be used: +elfshdr := $(shell echo '\#include <libelf.h>' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr) +CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED) + AWK = awk export srctree OUTPUT CFLAGS ARCH AWK include $(srctree)/tools/build/Makefile.include diff --git a/tools/objtool/elf.h b/tools/objtool/elf.h index 7f3e00a2f907..aa1ff6596684 100644 --- a/tools/objtool/elf.h +++ b/tools/objtool/elf.h @@ -23,6 +23,11 @@ #include <linux/list.h> #include <linux/hashtable.h> +#ifdef LIBELF_USE_DEPRECATED +# define elf_getshdrnum elf_getshnum +# define elf_getshdrstrndx elf_getshstrndx +#endif + struct section { struct list_head list; GElf_Shdr sh; |