[PATCH] D56554: [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK

Kamil Rytarowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 10 16:24:08 PST 2019


krytarowski added a comment.

What do you think about this new logic:

1. specified `-z execstack` -> do not emit GNU STACK segment
2. specified `-z noexecstack` -> emit GNU STACK segment
3. no option specified -> detect `findSection(".note.GNU-stack")` (I might miss offhand some details here to be sure if it is reliable)

3.1. detected -> emit GNU STACK segment
3.2. not detected -> do not emit GNU STACK segment

Additionally we will specify explicitly in the clang driver for Linux and FreeBSD `-z noexecstack`.

If this is not acceptable and we must use GNU extensions for everybody, we will need to specify this ugly `-z noexecstack` in the NetBSD driver (once we will get an agreement that we customize the linker through the driver).


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56554/new/

https://reviews.llvm.org/D56554





More information about the cfe-commits mailing list