All of lore.kernel.org
 help / color / mirror / Atom feed
From: geoff@infradead.org (Geoff Levand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] arm64: Add missing AT() macros to vmlinux.lds.S
Date: Fri, 13 Dec 2013 16:20:23 -0800	[thread overview]
Message-ID: <1386980423.1002.95.camel@smoke> (raw)
In-Reply-To: <20131213164958.GO19177@mudshark.cambridge.arm.com>


Hi Will,

On Fri, 2013-12-13 at 16:49 +0000, Will Deacon wrote:
> On Thu, Dec 12, 2013 at 08:39:46PM +0000, Geoff Levand wrote:
> > Add missing AT() macros to vmlinux.lds to generate the sections
> > properly.  Some elf file tools expect correct paddr values in
> > vmlinux.
> > 
> > Fixes bad paddr values written to vmlinux like these:
> > 
> >   Program Header:
> >     LOAD off 0x0000000000010000 vaddr 0xffffffc000080000 paddr 0xffffffc000080000 align 2**16
> > 
> > Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
> > ---
> >  arch/arm64/kernel/vmlinux.lds.S | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
> > index 6563b64..065fe40d 100644
> > --- a/arch/arm64/kernel/vmlinux.lds.S
> > +++ b/arch/arm64/kernel/vmlinux.lds.S
> > @@ -48,11 +48,11 @@ SECTIONS
> >  
> >  	. = PAGE_OFFSET + TEXT_OFFSET;
> >  
> > -	.head.text : {
> > +	.head.text : AT(ADDR(.head.text) - LOAD_OFFSET) {
> 
> Since LOAD_OFFSET is PAGE_OFFSET, does this assume that physical memory
> starts at 0x0?

Well, LOAD_OFFSET defaults to zero, so as of this patch, no, but
please see my comments to patch 5/5 (arm64: Add LOAD_OFFSET
symbol for linker scripts) where I do set LOAD_OFFSET...

The pre-defined macros from include/asm-generic/vmlinux.lds.h that we
use in our arm64 vmlinux.lds.S, like INIT_TEXT_SECTION() and BSS_SECTION(),
are all constructed using AT().  This patch is really just making all
the sections in the arm64 linker script consistent.  As I mentioned, when
LOAD_OFFSET is zero not having AT() macros on some sections doesn't cause
problems, but if LOAD_OFFSET is non-zero then some sections are not located
correctly resulting in a link error.

-Geoff

  reply	other threads:[~2013-12-14  0:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12 20:39 [PATCH 0/5] a few small fixups for arm64 Geoff Levand
2013-12-12 20:39 ` [PATCH 1/5] arm64: Fix __data_loc value Geoff Levand
2013-12-13 17:46   ` Russell King - ARM Linux
2013-12-13 18:17     ` Catalin Marinas
2013-12-14  0:20       ` Geoff Levand
2013-12-12 20:39 ` [PATCH 5/5] arm64: Add LOAD_OFFSET symbol for linker scripts Geoff Levand
2013-12-13 16:45   ` Will Deacon
2013-12-14  0:20     ` Geoff Levand
2013-12-14  0:31       ` Jason Gunthorpe
2013-12-16 17:29       ` Will Deacon
2013-12-17  0:21         ` Geoff Levand
2013-12-12 20:39 ` [PATCH 3/5] arm64: Fix include header order in vmlinux.lds.S Geoff Levand
2013-12-12 20:39 ` [PATCH 2/5] arm64: Fix the soft_restart routine Geoff Levand
2013-12-13 16:46   ` Will Deacon
2013-12-17  0:20     ` Geoff Levand
2013-12-12 20:39 ` [PATCH 4/5] arm64: Add missing AT() macros to vmlinux.lds.S Geoff Levand
2013-12-13 16:49   ` Will Deacon
2013-12-14  0:20     ` Geoff Levand [this message]
2013-12-14  0:20 ` [PATCH v2 1/5] arm64: Remove unused __data_loc variable Geoff Levand
2013-12-20 12:05   ` Catalin Marinas
2013-12-17  0:19 ` [PATCH v2 2/5] arm64: Fix the soft_restart routine Geoff Levand

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=1386980423.1002.95.camel@smoke \
    --to=geoff@infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.