|
1 # |
|
2 # Submitted upstream on 2017-01-23, it will be incorporated in the |
|
3 # the next release. |
|
4 # |
|
5 diff --git a/libdwarf/config.h.in b/libdwarf/config.h.in |
|
6 index c593643..980e3d4 100644 |
|
7 --- a/libdwarf/config.h.in |
|
8 +++ b/libdwarf/config.h.in |
|
9 @@ -79,6 +79,15 @@ |
|
10 /* Define 1 if libelf.h defines struct _Elf */ |
|
11 #undef HAVE_STRUCT_UNDERSCORE_ELF |
|
12 |
|
13 +/* Define to 1 if you have the <sys/elf_386.h> header file. */ |
|
14 +#undef HAVE_SYS_ELF_386_H |
|
15 + |
|
16 +/* Define to 1 if you have the <sys/elf_amd64.h> header file. */ |
|
17 +#undef HAVE_SYS_ELF_AMD64_H |
|
18 + |
|
19 +/* Define to 1 if you have the <sys/elf_SPARC.h> header file. */ |
|
20 +#undef HAVE_SYS_ELF_SPARC_H |
|
21 + |
|
22 /* Define to 1 if you have the <sys/ia64/elf.h> header file. */ |
|
23 #undef HAVE_SYS_IA64_ELF_H |
|
24 |
|
25 diff --git a/libdwarf/configure.in b/libdwarf/configure.in |
|
26 index 46ab313..7671896 100644 |
|
27 --- a/libdwarf/configure.in |
|
28 +++ b/libdwarf/configure.in |
|
29 @@ -12,7 +12,7 @@ AC_CHECK_TOOL(AR, ar) |
|
30 |
|
31 dnl AC_ARFLAGS |
|
32 |
|
33 -AC_CHECK_HEADERS(alloca.h elf.h unistd.h elfaccess.h libelf.h libelf/libelf.h sys/types.h sys/ia64/elf.h) |
|
34 +AC_CHECK_HEADERS(alloca.h elf.h unistd.h elfaccess.h libelf.h libelf/libelf.h sys/types.h sys/elf_386.h sys/elf_amd64.h sys/elf_SPARC.h sys/ia64/elf.h) |
|
35 |
|
36 dnl The default libdwarf is the one with struct Elf |
|
37 echo Assuming struct Elf for the default libdwarf.h |
|
38 diff --git a/libdwarf/dwarf_elf_access.c b/libdwarf/dwarf_elf_access.c |
|
39 index 5ebece9..a132a50 100644 |
|
40 --- a/libdwarf/dwarf_elf_access.c |
|
41 +++ b/libdwarf/dwarf_elf_access.c |
|
42 @@ -43,6 +43,16 @@ |
|
43 |
|
44 #ifdef HAVE_ELF_H |
|
45 #include <elf.h> |
|
46 +/* Relocations are in sys/elf_{mach}.h on Solaris. */ |
|
47 +#ifdef HAVE_SYS_ELF_AMD64_H |
|
48 +#include <sys/elf_amd64.h> |
|
49 +#endif |
|
50 +#ifdef HAVE_SYS_ELF_386_H |
|
51 +#include <sys/elf_386.h> |
|
52 +#endif |
|
53 +#ifdef HAVE_SYS_ELF_SPARC_H |
|
54 +#include <sys/elf_SPARC.h> |
|
55 +#endif |
|
56 #endif |
|
57 #ifdef HAVE_LIBELF_H |
|
58 #include <libelf.h> |