Re: Query on linker scripts

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

 



On 24/03/2012 05:43, Vaibhav Jain wrote:
> Hi,
[cut]
> 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 = .;
>      }
> }

I'm not sure if you are OT, anyway...

i.e. they are useful if you want to clear the bss section before execution.

[snippet for ARM proc]
...
	ldr	r2, =_sbss
	b	LoopFillZerobss
/* Zero fill the bss segment. */
FillZerobss:
	movs	r3, #0
	str	r3, [r2], #4

LoopFillZerobss:
	ldr	r3, = _ebss
	cmp	r2, r3
	bcc	FillZerobss
...

--
Carlo Caione

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux