On 03/24/2012 11:52 PM, Pranay Kumar Srivastava wrote:
________________________________________ From: kernelnewbies-bounces+pranay.shrivastava=hcl.com@kernelnewbies.org [kernelnewbies-bounces+pranay.shrivastava=hcl.com@kernelnewbies.org] On Behalf Of kernelnewbies-request@kernelnewbies.org [kernelnewbies-request@kernelnewbies.org] Sent: Saturday, March 24, 2012 9:30 PM To: kernelnewbies@kernelnewbies.org Subject: Kernelnewbies Digest, Vol 16, Issue 29
Send Kernelnewbies mailing list submissions to kernelnewbies@kernelnewbies.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies or, via email, send a message with subject or body 'help' to kernelnewbies-request@kernelnewbies.org
You can reach the person managing the list at kernelnewbies-owner@kernelnewbies.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Kernelnewbies digest..."
Today's Topics:
1. Query on linker scripts (Vaibhav Jain) 2. Re: Query on linker scripts (Carlo Caione)
----------------------------------------------------------------------
Message: 1 Date: Fri, 23 Mar 2012 21:43:40 -0700 From: Vaibhav Jain<vjoss197@gmail.com> Subject: Query on linker scripts To: kernelnewbies@kernelnewbies.org Message-ID: <CAKuUYSw=_zZykPWeTbJsGEYPPSroWK+whm0o5L_PnCManVcrng@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1"
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