binutils-revert-PLT-elision.patch 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d
  2. --- binutils.orig/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 13:32:39.335065263 +0000
  3. +++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 15:03:55.649727195 +0000
  4. @@ -2,6 +2,7 @@
  5. #readelf: -S --wide
  6. #as: --32
  7. +#pass
  8. #...
  9. +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
  10. #...
  11. diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d
  12. --- binutils.orig/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 13:32:39.329065335 +0000
  13. +++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 15:04:20.803430034 +0000
  14. @@ -3,7 +3,6 @@
  15. #readelf: -d --wide
  16. #as: --32
  17. -#failif
  18. #...
  19. +0x[0-9a-f]+ +\(PLTREL.*
  20. #...
  21. diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d
  22. --- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 13:32:39.336065251 +0000
  23. +++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 15:03:00.413379749 +0000
  24. @@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
  25. [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
  26. [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
  27. [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
  28. -
  29. +#...
  30. Symbol table '\.dynsym' contains [0-9]+ entries:
  31. +Num: +Value +Size Type +Bind +Vis +Ndx Name
  32. #...
  33. diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d
  34. --- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 13:32:39.330065323 +0000
  35. +++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 15:03:28.928042882 +0000
  36. @@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse
  37. [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
  38. [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
  39. [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
  40. -
  41. +#...
  42. Symbol table '\.dynsym' contains [0-9]+ entries:
  43. +Num: +Value +Size Type +Bind +Vis +Ndx Name
  44. #...
  45. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d
  46. --- binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 13:32:39.415064300 +0000
  47. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 15:08:39.333375801 +0000
  48. @@ -2,8 +2,4 @@
  49. #readelf: -S --wide
  50. #as: --64
  51. -#...
  52. - +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.*
  53. -#...
  54. - +\[ *[0-9]+\] \.got\.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+18 +.*
  55. #pass
  56. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d
  57. --- binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 13:32:39.404064432 +0000
  58. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 15:08:59.031143095 +0000
  59. @@ -3,7 +3,6 @@
  60. #readelf: -d --wide
  61. #as: --64
  62. -#failif
  63. #...
  64. +0x[0-9a-f]+ +\(PLTREL.*
  65. #...
  66. diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd
  67. --- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 13:32:39.407064397 +0000
  68. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 15:06:17.244054423 +0000
  69. @@ -1,4 +1,3 @@
  70. -#failif
  71. #...
  72. [0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0
  73. #...
  74. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d
  75. --- binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 13:32:39.412064336 +0000
  76. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 15:15:09.918750288 +0000
  77. @@ -20,6 +20,7 @@ Contents of the .eh_frame section:
  78. DW_CFA_offset: r16 \(rip\) at cfa-8
  79. DW_CFA_nop
  80. DW_CFA_nop
  81. +#pass
  82. 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
  83. DW_CFA_nop
  84. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d
  85. --- binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 13:32:39.413064324 +0000
  86. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 15:16:08.227055104 +0000
  87. @@ -20,6 +20,7 @@ Contents of the .eh_frame section:
  88. DW_CFA_offset: r16 \(rip\) at cfa-8
  89. DW_CFA_nop
  90. DW_CFA_nop
  91. +#pass
  92. 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
  93. DW_CFA_nop
  94. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d
  95. --- binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 13:32:39.413064324 +0000
  96. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 15:16:20.115913358 +0000
  97. @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
  98. DW_CFA_offset: r16 \(rip\) at cfa-8
  99. DW_CFA_nop
  100. DW_CFA_nop
  101. -
  102. +#pass
  103. +
  104. 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144
  105. DW_CFA_nop
  106. DW_CFA_nop
  107. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d
  108. --- binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 13:32:39.411064348 +0000
  109. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 15:16:29.012807282 +0000
  110. @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
  111. DW_CFA_offset: r16 \(rip\) at cfa-8
  112. DW_CFA_nop
  113. DW_CFA_nop
  114. -
  115. +#pass
  116. +
  117. 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144
  118. DW_CFA_nop
  119. DW_CFA_nop
  120. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d
  121. --- binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 13:32:39.408064384 +0000
  122. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 15:19:48.097433680 +0000
  123. @@ -19,7 +19,8 @@ Contents of the .eh_frame section:
  124. DW_CFA_offset: r16 \(rip\) at cfa-8
  125. DW_CFA_nop
  126. DW_CFA_nop
  127. -
  128. +#pass
  129. +
  130. 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
  131. DW_CFA_nop
  132. DW_CFA_nop
  133. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d
  134. --- binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 13:32:39.401064469 +0000
  135. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 15:10:56.077760324 +0000
  136. @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
  137. DW_CFA_offset: r16 \(rip\) at cfa-8
  138. DW_CFA_nop
  139. DW_CFA_nop
  140. -
  141. +#pass
  142. +
  143. 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4
  144. DW_CFA_nop
  145. DW_CFA_nop
  146. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d
  147. --- binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 13:32:39.405064420 +0000
  148. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 15:10:42.828916844 +0000
  149. @@ -19,6 +19,7 @@ Contents of the .eh_frame section:
  150. DW_CFA_offset: r16 \(rip\) at cfa-8
  151. DW_CFA_nop
  152. DW_CFA_nop
  153. +#pass
  154. 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd
  155. DW_CFA_nop
  156. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d
  157. --- binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 13:32:39.416064288 +0000
  158. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 15:11:11.550577531 +0000
  159. @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
  160. DW_CFA_offset: r16 \(rip\) at cfa-8
  161. DW_CFA_nop
  162. DW_CFA_nop
  163. -
  164. +#pass
  165. +
  166. 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd
  167. DW_CFA_nop
  168. DW_CFA_nop
  169. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d
  170. --- binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 13:32:39.411064348 +0000
  171. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 15:09:52.664509478 +0000
  172. @@ -19,7 +19,8 @@ Contents of the .eh_frame section:
  173. DW_CFA_offset: r16 \(rip\) at cfa-8
  174. DW_CFA_nop
  175. DW_CFA_nop
  176. -
  177. +#pass
  178. +
  179. 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231
  180. DW_CFA_nop
  181. DW_CFA_nop
  182. diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d
  183. --- binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 13:32:39.413064324 +0000
  184. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 15:11:22.975442559 +0000
  185. @@ -20,7 +20,8 @@ Contents of the .eh_frame section:
  186. DW_CFA_offset: r16 \(rip\) at cfa-8
  187. DW_CFA_nop
  188. DW_CFA_nop
  189. -
  190. +#pass
  191. +
  192. 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231
  193. DW_CFA_nop
  194. DW_CFA_nop
  195. diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd
  196. --- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 13:32:39.417064276 +0000
  197. +++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 15:05:02.950932110 +0000
  198. @@ -14,6 +14,7 @@ Section Headers:
  199. +\[[ 0-9]+\] .dynsym +.*
  200. +\[[ 0-9]+\] .dynstr +.*
  201. +\[[ 0-9]+\] .rela.dyn +.*
  202. +#pass
  203. +\[[ 0-9]+\] .plt +.*
  204. +\[[ 0-9]+\] .plt.got +.*
  205. +\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+31a 00 +AX +0 +0 4096
  206. --- binutils.orig/bfd/elfxx-x86.c 2018-01-22 15:59:25.875788033 +0000
  207. +++ binutils-2.30.0/bfd/elfxx-x86.c 2018-01-22 16:00:20.789146597 +0000
  208. @@ -107,7 +107,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
  209. plt_entry_size = htab->plt.plt_entry_size;
  210. resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh);
  211. -
  212. +#if 0
  213. /* We can't use the GOT PLT if pointer equality is needed since
  214. finish_dynamic_symbol won't clear symbol value and the dynamic
  215. linker won't update the GOT slot. We will get into an infinite
  216. @@ -125,7 +125,7 @@ elf_x86_allocate_dynrelocs (struct elf_l
  217. /* Use the GOT PLT. */
  218. eh->plt_got.refcount = 1;
  219. }
  220. -
  221. +#endif
  222. /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it
  223. here if it is defined and referenced in a non-shared object. */
  224. if (h->type == STT_GNU_IFUNC
  225. --- binutils.orig/ld/testsuite/ld-i386/pr20830.d 2018-07-09 09:49:51.277239857 +0100
  226. +++ binutils-2.30.90/ld/testsuite/ld-i386/pr20830.d 2018-07-09 10:32:41.113356733 +0100
  227. @@ -19,7 +19,7 @@ Contents of the .eh_frame section:
  228. DW_CFA_offset: r8 \(eip\) at cfa-4
  229. DW_CFA_nop
  230. DW_CFA_nop
  231. -
  232. +#pass
  233. 0+18 00000010 0000001c FDE cie=00000000 pc=00000128..00000133
  234. DW_CFA_nop
  235. DW_CFA_nop