All of lore.kernel.org
 help / color / mirror / Atom feed
From: vjoss197@gmail.com (Vaibhav Jain)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Query on linker scripts
Date: Fri, 23 Mar 2012 21:43:40 -0700	[thread overview]
Message-ID: <CAKuUYSw=_zZykPWeTbJsGEYPPSroWK+whm0o5L_PnCManVcrng@mail.gmail.com> (raw)

Hi,

Recently I have started reading tutorials for writing a small kernel. All
such tutorials mention use of linker scripts. I have
read few articles on linker scritps but I am stuck on one thing. I am
unable to understand the use of defining new symbols in linker scripts.
Using a linker script to arrange different sections in the object file is
understandable but defining symbols which are not referenced anywhere in
the script
is confusing. An example is the use of symbols sbss and ebss in the bss
section as show in the script below


ENTRY (loader)
SECTIONS
{
    . = 0x00100000;
    .text ALIGN (0x1000) :
    {
        *(.text)
    }
    .rodata ALIGN (0x1000) :
    {
        *(.rodata*)
    }
    .data ALIGN (0x1000) :
    {
        *(.data)
    }
    .bss :
    {
        sbss = .;
        *(COMMON)
        *(.bss)
        ebss = .;
    }
}

Please explain how defining such symbols is useful.

Thanks
Vaibhav Jain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120323/6e1741da/attachment.html 

             reply	other threads:[~2012-03-24  4:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-24  4:43 Vaibhav Jain [this message]
2012-03-24 15:26 ` Query on linker scripts Carlo Caione
2012-03-24 18:45 Pranay Kumar Srivastava
     [not found] ` <CAKuUYSwPiuGTa+8r6O+-GMLu9e6dXOXNfDHu4UBx2yvrHcQyvw@mail.gmail.com>
2012-03-26  6:41   ` Pranay Kumar Srivastava
2012-03-26 11:01     ` Vaibhav Jain
2012-03-26 11:54       ` Pranay Kumar Srivastava
2012-03-27  1:38         ` Vaibhav Jain
2012-03-27 11:00           ` Pranay Kumar Srivastava
2012-03-26 15:14       ` Dave Hylands

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='CAKuUYSw=_zZykPWeTbJsGEYPPSroWK+whm0o5L_PnCManVcrng@mail.gmail.com' \
    --to=vjoss197@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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.