Skip to content

Commit 96b730b

Browse files
phix33trufae
authored andcommitted
Add sectionless retpoline and swapped-thunk local PLT fixtures
1 parent d26e047 commit 96b730b

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

elf/pltrel/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ all:
1313
python3 -c "import struct;p='aarch64-pac-noshdr.so';d=bytearray(open(p,'rb').read());struct.pack_into('<Q',d,0x28,0);struct.pack_into('<H',d,0x3c,0);struct.pack_into('<H',d,0x3e,0);open(p,'wb').write(d)"
1414
powerpc-linux-gnu-gcc -O1 $(LDCOMMON) -o ppc32be.so plt.c
1515
powerpc-linux-gnu-gcc -mlittle-endian -O1 $(LDCOMMON) -o ppc32le.so plt.c
16+
cp x86_64-retpoline.so x86_64-retpoline-noshdr.so
17+
python3 -c "import struct;p='x86_64-retpoline-noshdr.so';d=bytearray(open(p,'rb').read());struct.pack_into('<Q',d,0x28,0);struct.pack_into('<H',d,0x3c,0);struct.pack_into('<H',d,0x3e,0);open(p,'wb').write(d)"
18+
# the first and last call thunks exchanged, which a linker reaches by emitting
19+
# one thunk per input file rather than one per relocation
20+
cp ppc32be.so ppc32be-swapped.so
21+
python3 -c "p='ppc32be-swapped.so';d=bytearray(open(p,'rb').read());a,b=0x260,0x280;d[a:a+16],d[b:b+16]=d[b:b+16],d[a:a+16];open(p,'wb').write(d)"

elf/pltrel/ppc32be-swapped.so

5.33 KB
Binary file not shown.
2.88 KB
Binary file not shown.

0 commit comments

Comments
 (0)