I tried with a two steps generation: first a call to "gcc" to generate a
.o file, then a call to "ld" to generate an executable.

I attached a minimal example program that does not need the libc or
standard crt.o. I used a slightly modified version of that program :

https://gist.github.com/lunixbochs/462ee21c3353c56b910f

in order to get the smallest "ld" command line possible. This is it:

ld -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o exe plop.o

I found that when the "-pie" option is removed, the ELF header Type
field changes from DYN to EXEC.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1635706

Title:
  gcc 6 outputs a shared object by default instead of an executable

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/build-essential/+bug/1635706/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to