From: Michael Ellerman <mpe@ellerman•id.au>
To: Nicholas Piggin <npiggin@gmail•com>
Cc: linuxppc-dev@lists•ozlabs.org, Anton Blanchard <anton@samba•org>,
Alan Modra <amodra@gmail•com>, Nick Clifton <nickc@redhat•com>,
gustavold@linux•vnet.ibm.com
Subject: Re: [PATCH] powerpc/boot: request no dynamic linker for boot wrapper
Date: Tue, 29 Nov 2016 14:42:34 +1100 [thread overview]
Message-ID: <87fumbq7dh.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20161128230724.375227b4@roar.ozlabs.ibm.com>
Nicholas Piggin <npiggin@gmail•com> writes:
> On Mon, 28 Nov 2016 22:07:39 +1100
> Michael Ellerman <mpe@ellerman•id.au> wrote:
>> Nicholas Piggin <npiggin@gmail•com> writes:
>> > diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
>> > index 404b3aa..cd941a8 100755
>> > --- a/arch/powerpc/boot/wrapper
>> > +++ b/arch/powerpc/boot/wrapper
>> > @@ -181,6 +181,13 @@ case "$elfformat" in
>> > elf32-powerpc) format=elf32ppc ;;
>> > esac
>> >
>> > +# 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
>>
>> Some distros (RHEL at least?), ship the wrapper as a standalone script.
>> So I don't think we can call things in $srctree. Or at least I don't
>> know how that's supposed to work when it's shipped standalone.
>> We're also basically reinventing ld-option, which is a PITA.
>
> Okay I didn't realize that. It's already using mkuboot.sh, but only
> for uboot targets... I don't know, I don't have any good ideas at the
> moment.
That looks like a bug, but I guess no one runs Fedora/RHEL on those
machines? Previously it just called mkimage using $PATH.
The Fedora spec file does:
make DESTDIR=$RPM_BUILD_ROOT bootwrapper_install WRAPPER_OBJDIR=%{_libdir}/kernel-wrapper WRAPPER_DTSDIR=%{_libdir}/kernel-wrapper/dts
bootwrapper_install installs a bunch of files, and also calls:
quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
cmd_install_wrapper = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\
sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \
-e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \
ie. it seds the script. So we could probably just install ld-version.sh
into $(DESTDIR)$(WRAPPER_OBJDIR) and then sed $srctree maybe?
But it's old code and I'm not that across how it gets used in the wild.
CC'ing Gustavo who is our Fedora/RHEL/Power guy.
cheers
next prev parent reply other threads:[~2016-11-29 3:42 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
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 [this message]
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=87fumbq7dh.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=amodra@gmail$(echo .)com \
--cc=anton@samba$(echo .)org \
--cc=gustavold@linux$(echo .)vnet.ibm.com \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=nickc@redhat$(echo .)com \
--cc=npiggin@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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