From 854df54e1839c8b96d1aaa9aeaa32c2ebbf535f8 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 13 Dec 2025 14:21:22 +0100 Subject: fix position independent loads of function symbols. For `extern int x[1];`, can use PCREL32 for &x. But for `extern int x(int)`, must use GOTREL, when not being called directly (that's PLT). Therefore the type of an external symbol (actually just whether it denotes a function) matters when deciding what kind of relocation to emit, so keep that information. --- test/reloc.c | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 test/reloc.c (limited to 'test/reloc.c') diff --git a/test/reloc.c b/test/reloc.c deleted file mode 100644 index ccc03ec..0000000 --- a/test/reloc.c +++ /dev/null @@ -1,9 +0,0 @@ - - -const void *const relro = &relro; - -float get_value(unsigned x) -{ - static const float values [] = {1.1f, 1.2f, 1.3f, 1.4f}; - return x < 4 ? values[x] : 0.0f; -} -- cgit v1.2.3