aboutsummaryrefslogtreecommitdiffhomepage
path: root/amd64
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-25 10:49:05 +0200
committerlemon <lsof@mailbox.org>2025-10-25 13:22:50 +0200
commitdacc801be75fa716b240a0c36d33db1d1cb06b58 (patch)
tree077a0311a9d58474bb22e5da116d266aa1fffe9f /amd64
parent33fc6630490f89014b78ea7839e0ec7c060c03dc (diff)
c: avoid generating relocations in .rodata (putting such objects in .data instead for now)
Diffstat (limited to 'amd64')
-rw-r--r--amd64/emit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/amd64/emit.c b/amd64/emit.c
index 2f4ad13..7ee1f93 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -337,7 +337,9 @@ encode(uchar **pcode, const struct desc *tab, int ntab, enum irclass k, struct o
if (mem.cindex == NOINDEX) {
/* %rip(var) */
static uchar offs[NOPERENC] = { [EN_MI8] = 1, [EN_MI16] = 2, [EN_MI32] = 4 };
- enum relockind r = (!conht[mem.con].deref && ccopt.pic) ? (rex ? REL_GOTPCRELX : REL_GOTPCRELX_REX) : REL_PCREL32;
+ enum relockind r =
+ (!conht[mem.con].deref && ccopt.pic) ? (rex ? REL_GOTPCRELX : REL_GOTPCRELX_REX)
+ : REL_PCREL32;
int off = -4 - offs[en->operenc];
B(/*mod 0*/ (reg & 7) << 3 | RBP);
objreloc(xcon2sym(mem.con), r, Stext, *pcode - objout.textbegin, mem.disp + off);