bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/29263] /usr/bin/ld: warning: /usr/lib/gcc/hppa-linux-gnu/11/../.


From: dave.anglin at bell dot net
Subject: [Bug ld/29263] /usr/bin/ld: warning: /usr/lib/gcc/hppa-linux-gnu/11/../../../hppa-linux-gnu/crtn.o: missing .note.GNU-stack section implies executable stack
Date: Mon, 20 Jun 2022 15:10:05 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29263

--- Comment #3 from dave.anglin at bell dot net ---
On 2022-06-20 7:13 a.m., nickc at redhat dot com wrote:
>> On hppa-linux with kernel v5.18 and later, we don't need an executable
>> stack for signal support but we still need it for gcc nested functions.
> This is already handled by gcc.  If an executable stack is needed in order to
> support nested functions (or more probably, taking the address of a nested
> function), then gcc will generate a .note.GNU-stack section with the read,
> write and execute permissions set.  The linker will then obligingly create an
> executable stack segment.  You will still get a warning message however, since
> the issue of executable stacks is still present, albeit for a different 
> reason.
Unfortunately, this doesn't happen on hppa-linux because we have:

/* It's not possible to enable GNU_stack notes since the kernel needs
    an executable stack for signal returns and syscall restarts.  */

#undef NEED_INDICATE_EXEC_STACK
#define NEED_INDICATE_EXEC_STACK 0

I can't just enable the generation of GNU_stack notes since old kernels are
still prevalent.

>
>
> The linker's warnings can be suppressed however, either via a run-time command
> line option:  --no-warn-execstack  or a build-time configure option:
> --enable-warn-execstack=no.
--no-warn-execstack doesn't suppress all the warnings:

dave@mx3210:~/shmat$ gcc main.c -Wl,--no-warn-execstack
/usr/bin/ld: warning: a.out has a LOAD segment with RWX permissions

>
>
> Is this sufficient ?  We could change the configuration option so that it
> defaults to disabling the warnings if the target is the HPPA, but I would
> prefer not to do that, as it means that a potential security vulnerability 
> will
> be ignored by default.
There is no way to fix the issue on hpux.  On linux, I believe the warning
causes issues
with some debian package builds.  For example, it looks like a recent build of
akonadi
failed due to the warning:

[  0%] Linking CXX shared library ../../bin/sqldrivers/libqsqlite3.so
cd /<<PKGBUILDDIR>>/obj-hppa-linux-gnu/src/qsqlite && /usr/bin/cmake -E
cmake_link_script CMakeFiles/qsqlite3.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -Wformat
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 
-fno-operator-names -fno-exceptions -Wall -Wextra -Wcast-align
-Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef 
-Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self
-Wvla -Wdate-time -Wsuggest-override -Wlogical-op -pedantic 
-Wzero-as-null-pointer-constant -Wmissing-include-dirs -Wnon-virtual-dtor
-Wundef -Wcast-align -Wchar-subscripts -Wall -Wextra -Wpointer-arith 
-Wformat-security -fno-common -pedantic -Wno-deprecated-copy -fexceptions
-Wl,--no-undefined -Wl,--fatal-warnings -Wl,--enable-new-dtags  
-shared -Wl,-soname,libqsqlite3.so -o ../../bin/sqldrivers/libqsqlite3.so
CMakeFiles/qsqlite3.dir/qsqlite3_autogen/mocs_compilation.cpp.o 
CMakeFiles/qsqlite3.dir/src/sqlite_blocking.cpp.o
CMakeFiles/qsqlite3.dir/src/qsql_sqlite.cpp.o
CMakeFiles/qsqlite3.dir/src/smain.cpp.o 
/usr/lib/hppa-linux-gnu/libQt5Sql.so.5.15.4
/usr/lib/hppa-linux-gnu/libsqlite3.so
/usr/lib/hppa-linux-gnu/libQt5Core.so.5.15.4
/usr/bin/ld: warning:
/usr/lib/gcc/hppa-linux-gnu/11/../../../hppa-linux-gnu/crtn.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
/usr/bin/ld: warning: ../../bin/sqldrivers/libqsqlite3.so has a LOAD segment
with RWX permissions
collect2: error: ld returned 1 exit status
make[3]: *** [src/qsqlite/CMakeFiles/qsqlite3.dir/build.make:149:
bin/sqldrivers/libqsqlite3.so] Error 1

What is best way to transition without causing a lot of disruption?

Regards,
Dave

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

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