linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Nicholas Piggin <npiggin@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org, Anton Blanchard <anton@samba.org>,
	Alan Modra <amodra@gmail.com>
Subject: Re: [PATCH] powerpc/boot: request no dynamic linker for boot wrapper
Date: Mon, 28 Nov 2016 12:39:38 +0000	[thread overview]
Message-ID: <a3674ff0-2c57-b04e-6cdf-3ac43296f854@redhat.com> (raw)
In-Reply-To: <20161128230724.375227b4@roar.ozlabs.ibm.com>

Hi Nicholas,

>>> The boot wrapper performs its own relocations and does not require
>>> PT_INTERP segment.
>>>
>>> Without this option, binutils 2.28 and newer tries to create a program
>>> header segment due to PT_INTERP, and the link fails because there is no
>>> space for it.  
>>
>> 2.28 is not released yet though is it?
>>
>> So can we just declare versions with that behaviour broken?
> 
> No it's not released yet, but I don't know if it's due entirely to binutils
> bug. Let's see what Nick thinks.

Well the patch that caused this problem was an attempt to fix the linker so 
that it would enforce the ELF standard.  Prior to the patch the linker would 
silently create binaries that violated the standard and which, at least for
the people reporting the problem in binutils PR 20815, failed to execute.

It now appears however that some programs, including the boot wrapper and the
Linux kernel, may actually rely upon non-standard ELF binaries being created.
Before I revert the patch however, I would like to ask...

>>> +# Do not include PT_INTERP segment when linking pie. Non-pie linking
>>> +# just ignores this option.
>>> +LD_VERSION=$(${CROSS}ld --version | $srctree/scripts/ld-version.sh)
>>> +LD_NO_DL_MIN_VERSION=$(echo 2.26 | $srctree/scripts/ld-version.sh)
>>> +if [ "$LD_VERSION" -ge "$LD_NO_DL_MIN_VERSION" ] ; then
>>> +	nodl="--no-dynamic-linker"
>>> +fi  

... this actually seems like a better fix to me.  If you do not want the 
PT_INTERP segment, then telling this linker this is a good idea.  So wouldn't
a patch like this be a better solution to the problem ?

Cheers
  Nick

  reply	other threads:[~2016-11-28 12:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28  1:42 [PATCH] powerpc/boot: request no dynamic linker for boot wrapper Nicholas Piggin
2016-11-28  2:26 ` Alan Modra
2016-11-28 11:07 ` Michael Ellerman
2016-11-28 12:07   ` Nicholas Piggin
2016-11-28 12:39     ` Nick Clifton [this message]
2016-11-28 13:02       ` Nicholas Piggin
2016-11-28 14:25         ` Nick Clifton
2016-11-29  1:49           ` Nicholas Piggin
2016-11-29  3:42     ` Michael Ellerman
2016-11-30 17:47       ` Gustavo Luiz Duarte
2016-12-05  7:47 ` Michael Ellerman

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=a3674ff0-2c57-b04e-6cdf-3ac43296f854@redhat.com \
    --to=nickc@redhat.com \
    --cc=amodra@gmail.com \
    --cc=anton@samba.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).