File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -341,7 +341,8 @@ void CheriCapRelocsSection::addCapReloc(CheriCapRelocLocation loc,
341341 " \n >>> Target: " + target.verboseToString (ctx));
342342
343343 bool canWriteLoc = (loc.section ->flags & SHF_WRITE) || !ctx.arg .zText ;
344- if (!canWriteLoc) {
344+ if (!canWriteLoc &&
345+ !(ctx.arg .isCheriot && loc.section ->name == " .captable" )) {
345346 readOnlyCapRelocsError (ctx, *target.sym (),
346347 " \n >>> referenced by " + sourceMsg ());
347348 return ;
@@ -595,7 +596,9 @@ void CheriCapRelocsSection::writeTo(uint8_t *buf) {
595596CheriCapTableSection::CheriCapTableSection (Ctx &ctx)
596597 : SyntheticSection(
597598 ctx, " .captable" , SHT_PROGBITS,
598- SHF_ALLOC | SHF_WRITE, /* XXX: actually RELRO for BIND_NOW*/
599+ SHF_ALLOC | (ctx.arg.isCheriot
600+ ? 0
601+ : SHF_WRITE), /* XXX: actually RELRO for BIND_NOW*/
599602 ctx.arg.capabilitySize) {
600603 assert (ctx.arg .capabilitySize > 0 );
601604 this ->entsize = ctx.arg .capabilitySize ;
You can’t perform that action at this time.
0 commit comments