This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A quick architecture status report


On Mon, Jul 10, 2017 at 8:56 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Mon, 10 Jul 2017, Zack Weinberg wrote:
>
>> Alas, this is significantly more research than I have time for.  I was
>> hoping for a simple matter of adding .note.GNU-stack annotations to
>> our own .S files :)
>
> Since we build with -Wa,--noexecstack if the compiler puts .note.GNU-stack
> sections in its output, that's never necessary.  What's needed in GCC is
> (a) a TARGET_ASM_FILE_END hook that uses file_end_indicate_exec_stack, (b)
> any assembly sources in libgcc need .note.GNU-stack annotations.  Easy to
> add, but architecture maintainers are best placed to know if that's the
> right thing to do for the particular architecture.

Hm, what do you think of this patch?  It makes elf/check-execstack an
expected failure on any target where the compiler doesn't put
.note.GNU-stack sections in its output.  (UNSUPPORTED might be more
appropriate, but I don't see a way to trigger that from a makefile
conditional.)

zw

diff --git a/elf/Makefile b/elf/Makefile
index e758a4c960..f62f31a45b 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1082,6 +1082,12 @@ $(objpfx)check-execstack.out:
$(..)scripts/check-execstack.awk \
        $(evaluate-test)
 generated += check-execstack.out

+# If the compiler does not support .note.GNU-stack for this
+# architecture, check-execstack is expected to fail.
+ifeq (,$(filter %noexecstack,$(ASFLAGS-config)))
+test-xfail-check-execstack = yes
+endif
+
 $(objpfx)tst-dlmodcount: $(libdl)
 $(objpfx)tst-dlmodcount.out: $(test-modules)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]