aboutsummaryrefslogtreecommitdiffhomepage
path: root/elf.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-09-14 17:59:39 +0200
committerlemon <lsof@mailbox.org>2025-09-14 18:24:05 +0200
commit7a318363ec4fdcd80d9d0154cef393c9bf205d5e (patch)
treec254e3a3b985bc22e84480346c856052ef9963ca /elf.c
parent5753e393954aca532abd6a5c10d6e8ab9a96c96c (diff)
preliminary pie and pic
Diffstat (limited to 'elf.c')
-rw-r--r--elf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/elf.c b/elf.c
index 399434b..7620961 100644
--- a/elf.c
+++ b/elf.c
@@ -118,6 +118,9 @@ static const ushort relktab[][NRELOCKIND] = {
[REL_ABS32] = 10, /* R_X86_64_32 */
[REL_ABS32S] = 11, /* R_X86_64_32S */
[REL_PCREL32] = 2, /* R_X86_64_PC32 */
+ [REL_PLT32] = 4, /* R_X86_64_PLT32 */
+ [REL_GOTPCRELX] = 41, /* R_X86_64_GOTPCRELX */
+ [REL_GOTPCRELX_REX] = 42, /* R_X86_64_REX_GOTPCRELX */
}
};
@@ -132,7 +135,7 @@ elfreloc(const char *sym, enum relockind kind, enum section section, uint off, v
case Sdata: ++ndatarel; break;
}
assert(kind < NRELOCKIND);
- vpush(&relocs, ((struct reloc) { section, relktab[mctarg->isa][kind], snam, off, addend}));
+ vpush(&relocs, ((struct reloc) { section, relktab[mctarg->isa][kind], snam, off, addend }));
}
static void