aboutsummaryrefslogtreecommitdiffhomepage
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to 'c')
-rw-r--r--c/c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/c/c.c b/c/c.c
index 4c4868b..d96ea5c 100644
--- a/c/c.c
+++ b/c/c.c
@@ -4308,8 +4308,8 @@ function(struct comp *cm, struct function *fn, const char **pnames, const struct
if (!ifunc) ifunc = intern("__func__");
union type ty = mkarrtype(mktype(TYCHAR), QCONST, strlen(fn->name) + 1);
const char *sym = mkhiddensym(fn->name, ifunc, 1);
- uint off = objnewdat(sym, Stext, 0, typesize(ty), typealign(ty));
- uchar *p = objout.textbegin + off;
+ uint off = objnewdat(sym, objout.code ? Stext : Srodata, 0, typesize(ty), typealign(ty));
+ uchar *p = objout.code ? objout.textbegin + off : objout.rodata.p + off;
memcpy(p, fn->name, typearrlen(ty)-1);
putdecl(cm, &(struct decl) {
.ty = ty, .qual = QCONST,