mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	Ingo Molnar <mingo@elte.hu>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"the arch/x86 maintainers" <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Absolute symbols in vmlinux_64.lds.S
Date: Mon, 9 Mar 2009 22:57:19 -0700	[thread overview]
Message-ID: <86802c440903092257i4b95b13evaabf50409b770113@mail.gmail.com> (raw)
In-Reply-To: <20090310053721.GA25977@uranus.ravnborg.org>

On Mon, Mar 9, 2009 at 10:37 PM, Sam Ravnborg <sam@ravnborg.org> wrote:
> On Mon, Mar 09, 2009 at 06:23:55PM -0700, Yinghai Lu wrote:
>> Jeremy Fitzhardinge wrote:
>> > Why does vmlinux_64.lds.S use absolute symbols for things like
>> > __bss_start/stop:
>> >
>> >  __bss_start = .;        /* BSS */
>> >  .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
>> >     *(.bss.page_aligned)
>> >     *(.bss)
>> >     }
>> >  __bss_stop = .;
>> >
>> >
>> > vmlinux_32.lds.S puts __bss_start/stop into the .bss section itself.  Is
>> > there some particular reason they need to be absolute symbols
>> > (relocation?).
>> >
>>
>> they are the same.
>
> Thats depends on the value of '.' where you assign __bss_start.
> We have had several bugs where the symbol assinged outside the
> section was less than expected because the linker aling the
> start of the section equal to the lrgest alignment requirement
> of a member in the section.
>
> So in this case if '.' equals to 0xabcd and the lagest
> alignment requirement inside the block is 0x1000 and we have
> __bss_start1 = .;
> .bss : {
>        __bss_start2 = .;
>        *(.bss.page_aligned)
> }
>
> Then you would see that:
> __bss_start1 equals 0xabcd
> __bss_start2 equals 0xb000

good to know...

anyway, more lines

  . = ALIGN(PAGE_SIZE);
  __nosave_begin = .;
  .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
      *(.data.nosave)
  } :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
  . = ALIGN(PAGE_SIZE);
  __nosave_end = .;

  __bss_start = .;              /* BSS */
  .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
        *(.bss.page_aligned)
        *(.bss)
        }
  __bss_stop = .;

  _end = . ;


there are extra ALIGN(PAGE_SIZE) between them....

YH

  parent reply	other threads:[~2009-03-10  5:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09 23:59 Jeremy Fitzhardinge
2009-03-10  1:23 ` Yinghai Lu
2009-03-10  5:37   ` Sam Ravnborg
2009-03-10  5:49     ` Eric W. Biederman
2009-03-10 20:20       ` H. Peter Anvin
2009-03-10 21:25         ` Eric W. Biederman
2009-03-10 22:26           ` Jeremy Fitzhardinge
2009-03-10  5:57     ` Yinghai Lu [this message]
2009-03-10 11:24       ` Sam Ravnborg
2009-03-10  1:36 ` Eric W. Biederman
2009-03-10  4:37 Jeremy Fitzhardinge
2009-03-10  5:32 ` Yinghai Lu

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=86802c440903092257i4b95b13evaabf50409b770113@mail.gmail.com \
    --to=yinghai@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sam@ravnborg.org \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®