From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] Static + PIE support
Date: Thu, 9 Jun 2016 23:10:05 +0200 [thread overview]
Message-ID: <20160609231005.6b289f42@free-electrons.com> (raw)
In-Reply-To: <20160609210130.GP6825@waldemar-brodkorb.de>
Hello,
On Thu, 9 Jun 2016 23:01:30 +0200, Waldemar Brodkorb wrote:
> > It would be good if you could investigate why uClibc doesn't produce
> > Scrt1.o when HAVE_SHARED is disabled.
>
> At the moment Scrt1.o is only build under following condition:
> ifeq ($(HAVE_SHARED)$(UCLIBC_FORMAT_SHARED_FLAT),y)
>
> I tried to compile a simple hello world as static PIE for ARM and
> this is not really straight forward. You need at least binutils 2.26
> to use -W,--no-dynamic-linker otherwise PT_INTERP is added to the
> resulting executable. After that I tried to run it in Qemu (system
> and user level tried) and the binary fails to execute with a
> segmentation fault.
> So even if we add Scrt1.o somehow to the toolchains, the binaries
> will not work on the target. Scrt1.o is just PIC version of crt1.c.
> So the PIC assembly in uClibc-ng might be just broken.
>
> Is it really required for flannel to work to use static PIE?
flannel is written in Go, so it's always built statically. So even when
a dynamically-linked capable toolchain is used (which provides
Scrt1.o), flannel is built as a static binary. Why would it work in
this case, and not a fully static toolchain ?
> In my point of view it is some kind of security feature used on
> Linux together with address space layout randomization.
> I don't know flannel, but security related software as OpenSSH
> does allow to build with and without PIE.
I agree that PIE should be optional, but I'm not sure if it's flannel
itself that decides to be built with PIE, or just the whole Go stuff.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-06-09 21:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-08 22:09 [Buildroot] Static + PIE support Thomas Petazzoni
2016-06-09 21:01 ` Waldemar Brodkorb
2016-06-09 21:10 ` Thomas Petazzoni [this message]
2016-06-09 21:11 ` Thomas Petazzoni
2016-06-09 21:17 ` [Buildroot] [uclibc-ng-devel] " Waldemar Brodkorb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160609231005.6b289f42@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox