[MIPS] hsdis need non-executable PT_GNU_STACK support

Leslie Zhai zhaixiang at loongson.cn
Tue Aug 14 10:46:35 UTC 2018


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




More information about the jdk8u-dev mailing list