public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux arch <linux-arch@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, Tim Abbott <tabbott@mit.edu>
Subject: Re: Minimal linker script
Date: Sun, 10 May 2009 10:55:04 +0200	[thread overview]
Message-ID: <20090510085504.GA18719@uranus.ravnborg.org> (raw)
In-Reply-To: <4A061158.3010604@zytor.com>

On Sat, May 09, 2009 at 04:27:20PM -0700, H. Peter Anvin wrote:
> Sam Ravnborg wrote:
> >  *      . = START;
> >  *      __init_begin = .;
> >  *      HEAD_SECTION
> >  *      INIT_TEXT_SECTION(PAGE_SIZE)
> >  *      INIT_DATA_SECTION(...)
> >  *      PERCPU(PAGE_SIZE)
> >  *      __init_end = .;
> >  *
> >  *      __text_begin = .;
> >  *      TEXT_SECTION = 0
> >  *      __text_end = .;
> >  *
> >  *      __data_begin = .;
> >  *      RO_DATA_SECTION(PAGE_SIZE)
> >  *      RW_DATA_SECTION(...)
> >  *      __data_end = .;
> >  *
> >  *      EXCEPTION_TABLE(...)
> >  *      NOTES
> >  *
> >  *      __bss_start = .;
> >  *      BSS_SECTION(0, 0)
> >  *      __bss_end = .;
> >  *      _end = .;
> >  *
> >  *
> >  * [__init_begin, __init_end] is the init section that may be freed after init
> >  * [_stext, _etext] is the text section
> >  * [_sdata, _edata] is the data section
> >  *
> >  * Some of the included output section include their own set of constants.
> >  * Examples are: [__initramfs_start, __initramfs_end] for initramfs and
> >  *               [__nosave_begin, __nosave_end] for the nosave data
> >  */
> > 
> 
> It seems rather disturbing to me that different sections have different
> start and end symbols.  I realize this is largely for historical
> reasons, but if we used a single pattern (e.g. something like
> __text_start, __text_end for the .text section)

The 'oldish' names were kept only because they are widely used.
I agree to be consistent is better so will change it to be so.

I edited the sample above to consistently use __<section>_{begin,end}.

For now I kept '_end' as I had no better name for it.

> then at least in the
> i386 case we could easily recognize those as relocatable symbols even if
> they show up as absolute.

Do you then say that i386 could allow us to use absolute symbols,
and we could adjust in the code instead?

That would make the linker script nicer but with added
complexity in the code..

	Sam

  parent reply	other threads:[~2009-05-10  8:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-09  8:00 Minimal linker script Sam Ravnborg
2009-05-09 23:27 ` H. Peter Anvin
2009-05-09 23:27   ` H. Peter Anvin
2009-05-10  8:55   ` Sam Ravnborg [this message]
2009-05-10 17:53     ` H. Peter Anvin

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=20090510085504.GA18719@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=hpa@zytor.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tabbott@mit.edu \
    /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