Google
  Web www.spinics.net

Query on linker scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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
 
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Newbies FAQ]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Networking]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

Add to Google Powered by Linux