https://sourceware.org/bugzilla/show_bug.cgi?id=33368

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Only the GNU linker properly sets sh_entsize on PLT and GOT sections:

[hjl@gnu-cfl-3 readelf-2]$ ld.gold -o gold.so -shared foo.o
[hjl@gnu-cfl-3 readelf-2]$ readelf -SW gold.so | grep -E "plt|got"
  [ 5] .rela.plt         RELA            00000000000002e8 0002e8 000078 18  AI 
1   6  8
  [ 6] .plt              PROGBITS        0000000000000360 000360 000050 10  AX 
0   0 16
  [10] .got              PROGBITS        0000000000001fd8 000fd8 000010 00  WA 
0   0  8
  [11] .got.plt          PROGBITS        0000000000001fe8 000fe8 000050 00  WA 
0   0  8
[hjl@gnu-cfl-3 readelf-2]$ ld.mold -o mold.so -shared foo.o
[hjl@gnu-cfl-3 readelf-2]$ readelf -SW mold.so | grep -E "plt|got"
  [ 6] .rela.plt         RELA            0000000000000380 000380 000030 18   A 
3  16  8
  [ 9] .plt              PROGBITS        00000000000013c0 0003c0 000040 00  AX 
0   0 16
  [10] .plt.got          PROGBITS        0000000000001400 000400 000008 00  AX 
0   0 16
  [13] .got              PROGBITS        0000000000002578 000578 000030 00  WA 
0   0  8
  [16] .got.plt          PROGBITS        00000000000035a8 0005a8 000028 00  WA 
0   0  8
[hjl@gnu-cfl-3 readelf-2]$ ld.lld -o lld.so -shared foo.o
[hjl@gnu-cfl-3 readelf-2]$ readelf -SW lld.so | grep -E "plt|got"
  [ 6] .rela.plt         RELA            0000000000000348 000348 000048 18  AI 
1  13  8
  [ 8] .plt              PROGBITS        00000000000013d0 0003d0 000040 00  AX 
0   0 16
  [10] .got              PROGBITS        00000000000024f0 0004f0 000028 00  WA 
0   0  8
  [13] .got.plt          PROGBITS        0000000000003518 000518 000030 00  WA 
0   0  8
[hjl@gnu-cfl-3 readelf-2]$ ld.bfd -o bfd.so -shared foo.o
[hjl@gnu-cfl-3 readelf-2]$ readelf -SW bfd.so | grep -E "plt|got"
  [ 1] .plt              PROGBITS        0000000000000190 000190 000040 10  AX 
0   0 16
  [ 2] .plt.got          PROGBITS        00000000000001d0 0001d0 000008 08  AX 
0   0  8
  [ 8] .rela.plt         RELA            0000000000001118 001118 000030 18  AI 
5  12  8
  [11] .got              PROGBITS        0000000000002fd8 001fd8 000010 08  WA 
0   0  8
  [12] .got.plt          PROGBITS        0000000000002fe8 001fe8 000048 08  WA 
0   0  8
[hjl@gnu-cfl-3 readelf-2]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to