bug-binutils
[Top][All Lists]
Advanced

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

linking an assembler object creates an executable stack


From: Alexander Pick
Subject: linking an assembler object creates an executable stack
Date: Mon, 5 Dec 2022 11:08:31 +0000
User-agent: Evolution 3.44.4-0ubuntu1

I reported this behaviour to the gcc team, but they told me it's rather
related to binutils. So I wanted to leave a note here.

Reference to the gcc ticket:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107971

During development of a project I noticed that linking a object created
from assembler to another object created from C code results in a
binary with executable stack.

There is also no warning that the stack is executable during the
process. From the documentation it reads as if there should be one: 

"On the other hand the linker will normally warn if the stack is made
executable"

Ref:
https://sourceware.org/binutils/docs-2.39/ld/Options.html#index-_002d_002dwarn_002dexecstack

In my case the executable stack caused some totally unrelated issues
which were very difficult to debug.

I attached a testcase which demonstrates the issue. The testcase uses
gcc for linking but using ld directly has the same result.

Even if this is intended behaviour, the mentioned warning that the
stack is now executable would be nice to have.

Thanks,
Alex

Attachment: testcase.tgz
Description: testcase.tgz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]