I compiled the same project on ubuntu20.04 in wsl and my main used OS archLinux respectively. On wsl, everything went normal, while on archlinux the error message as follows would show:
/usr/bin/ld: warning: trap.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
It seems like a error caused by the linker ld, the version message of it on my linux os is:
GNU ld (GNU Binutils) 2.39
Copyright (C) 2022 Free Software Foundation, Inc.
And it on my wsl is:
GNU ld (GNU Binutils for Ubuntu) 2.34
Copyright (C) 2020 Free Software Foundation, Inc.
On arch, gcc's version is 12.1.1, while on wsl it is gcc 9.3.0
Was it caused by the difference between the old and new versions? How can I fix it?
trap
in that project. Where doestrap.o
come from? – Alithiatrap
in the abstract-machine/am/build/native/src/native directory. – Inveracitytrap.o
is being generated without aGNU-stack
note, and the old default behavior was that this allows an executable stack. The newer default behavior will be that this prevents an executable stack. So program behavior could change in future versions. Looks like it's not easy to disable linker warnings. If you want to explicitly add aGNU-stack
note with-execstack
orno-execstack
that would fix it. Tryno-execstack
first and see if that leads to a segfault. – AlithiaMakefile
offceux-am
, seems like it doesn't make any difference. The same message is shown. Did I do anything wronG? – Inveracitytrap.o
. Did the generatedtrap.o
function include the.notes.GNU-stack
line? If not, then the compiler flag did nothing. Does the Makefile infceux-am
have anything to do with compilingtrap.o
? – Alithia/usr/bin/ld: warning: -z no-execstack ignored
this will be shown; while using execstack, nothing include the linker warning was shown. So I guess this is it? – Inveracityexecstack
to your compilation, your program's stack is now executable. That's a security issue. I'd rather have the warning on linking than the security issue forever. – Alithia