NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-sparc/60838: sparc fails to enforce RLIMIT_DATA on exec



> Date: Fri, 2 Oct 2026 16:43:03 +0000
> From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
> 
> Is it expected that sparc executables have only RX and RWX segments,
> no separate R or RW segments?  Does sparc have some stupid ABI design
> that is incompatible with W^X?

Answer: looks like yes, the sparc and sparc64 PLT design in the SysV
ABI relies on writable text at runtime to resolve symbols in PLT
stubs, and that's what we do:

https://nxr.NetBSD.org/xref/src/sys/arch/sparc/include/elf_support.h?r=1.1#31
https://nxr.NetBSD.org/xref/src/libexec/ld.elf_so/arch/sparc/mdreloc.c?r=1.60#480

And the .plt section is the only one having both write and execute
flags in all the executables I checked.

Apparently the VxWorks ABI supports secure-PLT through GOT indirection
like ~every other architecture these days, but while binutils supports
the VxWorks ABI and some people were talking about adapting it to what
is presumably a SysV ABI context twenty years ago, it looks like that
never happened:

https://sourceware.org/pipermail/binutils/2006-March/046258.html



Home | Main Index | Thread Index | Old Index