This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [MIPS] hsdis need non-executable PT_GNU_STACK support
- From: Leslie Zhai <zhaixiang at loongson dot cn>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, faraz dot shahbazker at imgtec dot com, macro at imgtec dot com, Huacai Chen <chenhc at lemote dot com>, 8u-dev <jdk8u-dev at openjdk dot java dot net>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, libc-alpha at sourceware dot org
- Date: Tue, 14 Aug 2018 18:46:35 +0800
- Subject: Re: [MIPS] hsdis need non-executable PT_GNU_STACK support
- References: <d348bfdd-505c-73e0-6434-8d3f6a762880@loongson.cn> <8ffbcb10-c253-c0ef-3c02-4d85e6359766@redhat.com> <4faa30a3-3f3f-95b3-3eac-030644807a81@loongson.cn> <0680a725-2574-286c-5775-320de987b6f1@redhat.com> <094c12fe-4e5e-60cb-3f77-ac27b633664b@loongson.cn> <alpine.DEB.2.20.1808140940120.2536@digraph.polyomino.org.uk>
Hi Joseph,
Thanks for your response!
hsdis is just able to workaround when linking with -Wl,-z,noexecstack
flag, and my environment:
$ uname -a
Linux localhost.localdomain 3.10.84-19.fc21.loongson.2.mips64el #1 SMP
PREEMPT Fri Jul 6 18:47:47 CST 2018 mips64 mips64 mips64 GNU/Linux
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/mips64el-redhat-linux/4.9.3/lto-wrapper
Target: mips64el-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--enable-multilib --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-arch=loongson3a
--enable-languages=c,c++,objc,obj-c++,fortran,go,lto --enable-plugin
--disable-libgcj
--with-isl=/builddir/build/BUILD/gcc-4.9.3/obj-mips64el-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.9.3/obj-mips64el-redhat-linux/cloog-install
--enable-gnu-indirect-function --with-long-double-128
--build=mips64el-redhat-linux
Thread model: posix
gcc version 4.9.3 20150626 (Red Hat 4.9.3-8) (GCC)
$ ld -v
GNU ld version 2.24
$ rpm -q glibc
glibc-2.20-15.fc21.loongson.10.mips64el
But I want to find out the root cause, I have no idea whether or not
kernel supported ELF MIPS_GNU_STACK:
+ /* Flag to indicate that non-executable stack supported by kernel.
+ Ref: arch/mips/include/asm/elf.h in kernel sources. */
+#define AV_FLAGS_MIPS_GNU_STACK (1 << 24)
https://sourceware.org/ml/libc-alpha/2016-01/msg00568.html
But what is the status of kernel and toolchain for X86? Why it is *not* able to reproduce the hsdis issue for X86?
And I can prepare the test environment with the latest kernel and toolchain applied with your patch. Please give me some suggestion to support your job, thanks a lot!
在 2018年08月14日 17:43, Joseph Myers 写道:
On Tue, 14 Aug 2018, Leslie Zhai wrote:
The root cause is the patch [MIPS] Enable non-executable PT_GNU_STACK support,
contributed by Faraz in 2016 February, had not been merged by GCC toolchain
upstream.
https://gcc.gnu.org/ml/gcc-patches/2016-02/msg00444.html
Was there a non-RFC GCC patch posting? RFC means you're looking for
comments with a view to producing later patch versions, not for an actual
review with a view to getting that version of the changes checked in.
As noted in <https://sourceware.org/ml/libc-alpha/2016-12/msg00853.html>
you'll need a non-RFC glibc patch posting, with architecture-independent
and MIPS-specific parts split out, and with comments pointing to the
upstream releases of kernel, GCC, binutils with relevant support.
--
Regards,
Leslie Zhai