avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] strange behaviour of avr-ld, maybe a bug?


From: Boyapati, Anitha
Subject: RE: [avr-gcc-list] strange behaviour of avr-ld, maybe a bug?
Date: Thu, 17 Feb 2011 13:18:40 +0800


>-----Original Message-----
>From: address@hidden
>[mailto:address@hidden On
>Behalf Of Erik Christiansen
>Sent: Monday, February 14, 2011 7:59 PM
>To: address@hidden
>Subject: Re: [avr-gcc-list] strange behaviour of avr-ld, maybe a bug?
>
>> >
>> >If you compile you will obtain a binary bigger than 32KB
>> >I would expect a linker error like:
>> >region `text' overflowed by xx bytes
>> >
>>
>> I don't think so. If .text section alone is more than 32KB, linker
>> will complain. I don't think that is the case here.
>
>Ahem, avr-ld is doing what you describe, but that is the problem. Where
>more than one output section's LMA directs its LOAD data to a common
>memory region, the test you describe is entirely inadequate. That is why
>gnu ld _has_ historically detected memory region overflow. Although I
>only found one unrelated match on "overflow", using the search engine at
>the binutils ML archive (http://sourceware.org/ml/binutils/), my own
>archive from 2006 has this:
>
>>>>
>Message-ID: <address@hidden>
>
> > We have a large program in which many different object
> > file sections are placed into various fixed size
> > memory regions and I want to be sure that the linker
> > will tell me when I overflow one of these regions.
>
>I think that you can be sure of this.
>
>Cheers
>   Nick
><<<
>
>Nick Clifton's response can be taken as definitive, I'd suggest.
>
>Being curious whether the regression is generic or specific to the avr
>toolchain, I've queried binutils. In a day or two we should have a
>clearer idea on that score. (Feedback thus far is inconclusive.)
>
>When we invoke LMA concatenation across output sections, as is done for
>.data in the avr default linker scripts, ld is performing the related
>arithmetic, and it is a bug for it to fail to test for overflow as it
>(currently blindly) stuffs bytes into the destination memory region.
>
>On closer examination, I think you'll probably agree. ;-))


Oops sorry! I have been busy with other things that I did not check this for a 
while. 

I think you are right in that the linker should take care of the situation 
where more than one section loads into a common section/region. I need to give 
some more thought on it. Will get back if I think otherwise :-)

Anitha




reply via email to

[Prev in Thread] Current Thread [Next in Thread]