2 ms·
Why would a binary data object contain a stack section at all? Does the lack of NX-stack carry over to the executable?
by 0x0 11y ago
Why would a binary data object contain a stack section at all? Does the lack of NX-stack carry over to the executable?
- rwmj 11y agoNo binary object file "has a stack" since it's created ephemerally for the executable at runtime. However the linker checks all objects and determines if any of them contain code that requires an executable stack. For backwards compat reasons, that check will say "executable stack needed" for objects that don't contain the special section flag. In other words, the check is a logical && operation across all the objects, and therefore somewhat fragile. It's for this reason that in RHEL we have a separate check for all the RPMs we ship to make sure that none of them contain executable stack binaries (well, except in some rather exceptional circumstances). I think you can argue this is a bug in the linker command that creates the binary blob object.