public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Global array is at an offset from the top of the bss section, instead of being at the top
@ 2014-06-20  5:50 Nagaraju Mekala
  2014-06-20  6:22 ` Senthil Kumar Selvaraj
  0 siblings, 1 reply; 3+ messages in thread
From: Nagaraju Mekala @ 2014-06-20  5:50 UTC (permalink / raw)
  To: binutils

Hi,

   I want to understand why few bytes are reserved in start of the bss section

  I have an array defined on top of the source code as follow:

static int DestinationAddress[BUF_SIZE] ;

My expectation is the linker will put it on top of the .bss section.
However I notice there are always 28 bytes sitting in front of
DestinationAddress[] no matter what I do.

ffff0000 l       .bss      00000000 completed.8489
ffff0004 l       .bss      00000000 object.8494
ffff001c l     O .bss      00007000 DestinationAddress

I was hoping the linker puts DestinationAddress at 0xffff0000. It is
not clear to me what these items (completed.8489, object.8494) are.

 Can anyone please throw some light on it.

Thanks in Advance,
Nagaraju

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Global array is at an offset from the top of the bss section, instead of being at the top
  2014-06-20  5:50 Global array is at an offset from the top of the bss section, instead of being at the top Nagaraju Mekala
@ 2014-06-20  6:22 ` Senthil Kumar Selvaraj
  2014-06-23  5:47   ` Nagaraju Mekala
  0 siblings, 1 reply; 3+ messages in thread
From: Senthil Kumar Selvaraj @ 2014-06-20  6:22 UTC (permalink / raw)
  To: Nagaraju Mekala; +Cc: binutils

On Fri, Jun 20, 2014 at 11:20:49AM +0530, Nagaraju Mekala wrote:
> Hi,
> 
>    I want to understand why few bytes are reserved in start of the bss section
> 
>   I have an array defined on top of the source code as follow:
> 
> static int DestinationAddress[BUF_SIZE] ;
> 
> My expectation is the linker will put it on top of the .bss section.
> However I notice there are always 28 bytes sitting in front of
> DestinationAddress[] no matter what I do.
> 
> ffff0000 l       .bss      00000000 completed.8489
> ffff0004 l       .bss      00000000 object.8494
> ffff001c l     O .bss      00007000 DestinationAddress
> 
> I was hoping the linker puts DestinationAddress at 0xffff0000. It is
> not clear to me what these items (completed.8489, object.8494) are.
> 
>  Can anyone please throw some light on it.

Unless the linker itself put those two items, it must have come from
some object file (and eventually some source file).

If you link with -Wl,-Map=<some map filename>, the generated file will
tell you which object file the two items came from. You can then go back
to which source file from which the object file was generated.

Hope that helps.

Regards
Senthil

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Global array is at an offset from the top of the bss section, instead of being at the top
  2014-06-20  6:22 ` Senthil Kumar Selvaraj
@ 2014-06-23  5:47   ` Nagaraju Mekala
  0 siblings, 0 replies; 3+ messages in thread
From: Nagaraju Mekala @ 2014-06-23  5:47 UTC (permalink / raw)
  To: Senthil Kumar Selvaraj; +Cc: binutils

Hi Senthil,

  Thanks for the reply.

On Fri, Jun 20, 2014 at 11:51 AM, Senthil Kumar Selvaraj
<senthil_kumar.selvaraj@atmel.com> wrote:
> On Fri, Jun 20, 2014 at 11:20:49AM +0530, Nagaraju Mekala wrote:
>> Hi,
>>
>>    I want to understand why few bytes are reserved in start of the bss section
>>
>>   I have an array defined on top of the source code as follow:
>>
>> static int DestinationAddress[BUF_SIZE] ;
>>
>> My expectation is the linker will put it on top of the .bss section.
>> However I notice there are always 28 bytes sitting in front of
>> DestinationAddress[] no matter what I do.
>>
>> ffff0000 l       .bss      00000000 completed.8489
>> ffff0004 l       .bss      00000000 object.8494
>> ffff001c l     O .bss      00007000 DestinationAddress
>>
>> I was hoping the linker puts DestinationAddress at 0xffff0000. It is
>> not clear to me what these items (completed.8489, object.8494) are.
>>
>>  Can anyone please throw some light on it.
>
> Unless the linker itself put those two items, it must have come from
> some object file (and eventually some source file).
>
> If you link with -Wl,-Map=<some map filename>, the generated file will
> tell you which object file the two items came from. You can then go back
> to which source file from which the object file was generated.
>
> Hope that helps.
I got the required info. These 28 bytes are from crt files.

Thanks a lot,
Nagaraju

> Regards
> Senthil

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-23  5:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-20  5:50 Global array is at an offset from the top of the bss section, instead of being at the top Nagaraju Mekala
2014-06-20  6:22 ` Senthil Kumar Selvaraj
2014-06-23  5:47   ` Nagaraju Mekala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).