2
0

900-fix-undefined-macro-access.patch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. --- a/lib/elf_repl.h
  2. +++ b/lib/elf_repl.h
  3. @@ -45,7 +45,7 @@ typedef __libelf_u32_t Elf32_Word;
  4. #define ELF32_FSZ_SWORD 4
  5. #define ELF32_FSZ_WORD 4
  6. -#if __LIBELF64
  7. +#if defined(__LIBELF64)
  8. typedef __libelf_u64_t Elf64_Addr;
  9. typedef __libelf_u16_t Elf64_Half;
  10. @@ -93,7 +93,7 @@ typedef struct {
  11. Elf32_Half e_shstrndx;
  12. } Elf32_Ehdr;
  13. -#if __LIBELF64
  14. +#if defined(__LIBELF64)
  15. typedef struct {
  16. unsigned char e_ident[EI_NIDENT];
  17. Elf64_Half e_type;
  18. @@ -307,7 +307,7 @@ typedef struct {
  19. Elf32_Word sh_entsize;
  20. } Elf32_Shdr;
  21. -#if __LIBELF64
  22. +#if defined(__LIBELF64)
  23. typedef struct {
  24. Elf64_Word sh_name;
  25. Elf64_Word sh_type;
  26. @@ -434,7 +434,7 @@ typedef struct {
  27. Elf32_Half st_shndx;
  28. } Elf32_Sym;
  29. -#if __LIBELF64
  30. +#if defined(__LIBELF64)
  31. typedef struct {
  32. Elf64_Word st_name;
  33. unsigned char st_info;
  34. @@ -457,7 +457,7 @@ typedef struct {
  35. #define ELF32_ST_TYPE(i) ((i)&0xf)
  36. #define ELF32_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
  37. -#if __LIBELF64
  38. +#if defined(__LIBELF64)
  39. #define ELF64_ST_BIND(i) ((i)>>4)
  40. #define ELF64_ST_TYPE(i) ((i)&0xf)
  41. #define ELF64_ST_INFO(b,t) (((b)<<4)+((t)&0xf))
  42. @@ -495,7 +495,7 @@ typedef struct {
  43. * Macros for manipulating st_other
  44. */
  45. #define ELF32_ST_VISIBILITY(o) ((o)&0x3)
  46. -#if __LIBELF64
  47. +#if defined(__LIBELF64)
  48. #define ELF64_ST_VISIBILITY(o) ((o)&0x3)
  49. #endif /* __LIBELF64 */
  50. @@ -521,7 +521,7 @@ typedef struct {
  51. Elf32_Sword r_addend;
  52. } Elf32_Rela;
  53. -#if __LIBELF64
  54. +#if defined(__LIBELF64)
  55. typedef struct {
  56. Elf64_Addr r_offset;
  57. Elf64_Xword r_info;
  58. @@ -541,7 +541,7 @@ typedef struct {
  59. #define ELF32_R_TYPE(i) ((unsigned char)(i))
  60. #define ELF32_R_INFO(s,t) (((s)<<8)+(unsigned char)(t))
  61. -#if __LIBELF64
  62. +#if defined(__LIBELF64)
  63. #define ELF64_R_SYM(i) ((Elf64_Xword)(i)>>32)
  64. #define ELF64_R_TYPE(i) ((i)&0xffffffffL)
  65. #define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
  66. @@ -556,7 +556,7 @@ typedef struct {
  67. Elf32_Word n_type; /* descriptor type */
  68. } Elf32_Nhdr;
  69. -#if __LIBELF64
  70. +#if defined(__LIBELF64)
  71. /* Solaris and GNU use this layout. Be compatible. */
  72. /* XXX: Latest ELF specs say it's 64-bit!!! */
  73. typedef struct {
  74. @@ -587,7 +587,7 @@ typedef struct {
  75. Elf32_Word p_align;
  76. } Elf32_Phdr;
  77. -#if __LIBELF64
  78. +#if defined(__LIBELF64)
  79. typedef struct {
  80. Elf64_Word p_type;
  81. Elf64_Word p_flags;
  82. @@ -654,7 +654,7 @@ typedef struct {
  83. } d_un;
  84. } Elf32_Dyn;
  85. -#if __LIBELF64
  86. +#if defined(__LIBELF64)
  87. typedef struct {
  88. Elf64_Sxword d_tag;
  89. union {
  90. @@ -798,7 +798,7 @@ typedef struct {
  91. Elf32_Half si_flags;
  92. } Elf32_Syminfo;
  93. -#if __LIBELF64
  94. +#if defined(__LIBELF64)
  95. typedef struct {
  96. Elf64_Half si_boundto;
  97. Elf64_Half si_flags;
  98. @@ -863,7 +863,7 @@ typedef struct {
  99. typedef Elf32_Half Elf32_Versym;
  100. -#if __LIBELF64
  101. +#if defined(__LIBELF64)
  102. typedef struct {
  103. Elf64_Half vd_version;
  104. @@ -933,7 +933,7 @@ typedef Elf64_Half Elf64_Versym;
  105. /*
  106. * Move section
  107. */
  108. -#if __LIBELF64
  109. +#if defined(__LIBELF64)
  110. typedef struct {
  111. Elf32_Lword m_value;
  112. @@ -973,7 +973,7 @@ typedef struct {
  113. } c_un;
  114. } Elf32_Cap;
  115. -#if __LIBELF64
  116. +#if defined(__LIBELF64)
  117. typedef struct {
  118. Elf64_Xword c_tag;
  119. --- a/lib/gelf.h
  120. +++ b/lib/gelf.h
  121. @@ -22,15 +22,15 @@
  122. #ifndef _GELF_H
  123. #define _GELF_H
  124. -#if __LIBELF_INTERNAL__
  125. +#if defined(__LIBELF_INTERNAL__)
  126. #include <libelf.h>
  127. #else /* __LIBELF_INTERNAL__ */
  128. #include <libelf/libelf.h>
  129. #endif /* __LIBELF_INTERNAL__ */
  130. -#if __LIBELF_NEED_LINK_H
  131. +#if defined(__LIBELF_NEED_LINK_H)
  132. #include <link.h>
  133. -#elif __LIBELF_NEED_SYS_LINK_H
  134. +#elif defined(__LIBELF_NEED_SYS_LINK_H)
  135. #include <sys/link.h>
  136. #endif /* __LIBELF_NEED_LINK_H */
  137. @@ -71,7 +71,7 @@ typedef Elf64_Sym GElf_Sym;
  138. /*
  139. * Symbol versioning
  140. */
  141. -#if __LIBELF_SYMBOL_VERSIONS
  142. +#if defined(__LIBELF_SYMBOL_VERSIONS)
  143. typedef Elf64_Verdef GElf_Verdef;
  144. typedef Elf64_Verneed GElf_Verneed;
  145. typedef Elf64_Verdaux GElf_Verdaux;
  146. --- a/lib/libelf.h
  147. +++ b/lib/libelf.h
  148. @@ -25,7 +25,7 @@
  149. #include <stddef.h> /* for size_t */
  150. #include <sys/types.h>
  151. -#if __LIBELF_INTERNAL__
  152. +#if defined(__LIBELF_INTERNAL__)
  153. #include <sys_elf.h>
  154. #else /* __LIBELF_INTERNAL__ */
  155. #include <libelf/sys_elf.h>
  156. @@ -224,7 +224,7 @@ extern Elf_Data *elf32_xlatetom __P((Elf
  157. */
  158. extern long elf32_checksum __P((Elf *__elf));
  159. -#if __LIBELF64
  160. +#if defined(__LIBELF64)
  161. /*
  162. * 64-bit ELF functions
  163. * Not available on all platforms
  164. --- a/lib/sys_elf.h.in
  165. +++ b/lib/sys_elf.h.in
  166. @@ -116,7 +116,7 @@ Foundation, Inc., 51 Franklin Street, Fi
  167. # define ELF64_R_INFO(s,t) (((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
  168. # endif /* ELF64_R_SYM */
  169. -# if __LIBELF64_LINUX
  170. +# if defined(__LIBELF64_LINUX)
  171. typedef __libelf_u64_t Elf64_Addr;
  172. typedef __libelf_u16_t Elf64_Half;
  173. typedef __libelf_u64_t Elf64_Off;