public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Pankaj Bansal <pankaj.bansal@nxp.com>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Varun Sethi <V.Sethi@nxp.com>
Subject: Re: AARCH64 : C Model Small Alignment requirements
Date: Fri, 26 May 2017 11:06:18 +0200	[thread overview]
Message-ID: <CAKv+Gu8kHJm1CcznuoTRbnSgP6w979oTeecpoO=qpG_29c8uJw@mail.gmail.com> (raw)
In-Reply-To: <DBXPR04MB144A366BA9338D66AB8E40FF1FC0@DBXPR04MB144.eurprd04.prod.outlook.com>

On 26 May 2017 at 01:02, Pankaj Bansal <pankaj.bansal@nxp.com> wrote:
> Hello Edk2 team,
>
> We are facing a compilation error in our ARMV8 based NXP board.
> We are using c model small with GCC49 and GCC5.
>
> "WriteSections64(): %s  due to its size (> 1 MB), this module requires 4 KB
> section alignment."
>
> With below GCC options, this error is not observed
>
> [BuildOptions]
>    GCC:*_*_AARCH64_CC_FLAGS = -mcmodel=small
> +  GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x1000
>
> My question is, is this necessary to use page size 4K with c model small ?
>

Yes. The small C model relies on ADRP instructions, which require the
link time and load time offsets of the executable to be equal modulo
4096.

> P.S : This compilation error is not observed with default GCC49/GCC5 options
> (i.e. C Model tiny and Page Size 0x20)
>

The tiny C model does not have this limitation because it uses ADR
instructions instead, whose range is limited to 1 MB. The PE/COFF
conversion tool will convert small C model code to tiny C model code
if it can, i.e., if the module size < 1 MB. For bigger modules, this
is not possible, which is when you get the error above.


      reply	other threads:[~2017-05-26  9:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26  8:02 AARCH64 : C Model Small Alignment requirements Pankaj Bansal
2017-05-26  9:06 ` Ard Biesheuvel [this message]

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-list 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='CAKv+Gu8kHJm1CcznuoTRbnSgP6w979oTeecpoO=qpG_29c8uJw@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /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