[coreboot] global variables in romstage

Stefan Reinauer stefan.reinauer at coresystems.de
Sat Aug 14 12:47:40 CEST 2010


 On 8/14/10 12:40 PM, Carl-Daniel Hailfinger wrote:
> On 14.08.2010 12:24, Stefan Reinauer wrote:
>>  On 8/14/10 11:50 AM, Carl-Daniel Hailfinger wrote:
>>   
>>> On 14.08.2010 11:40, Stefan Reinauer wrote:
>>>     
>>>>  On 8/12/10 9:27 PM, Patrick Georgi wrote:
>>>>   
>>>>       
>>>>> 1. [...]
>>>>> This one looks for the size of .bss and .data (initialized and
>>>>> uninitialized globals) and breaks the build if it finds any. It doesn't
>>>>> tell, which global variables are involved.
>>>>>
>>>>>
>>>>> 2. Add .bss and .data to /DISCARD/.
>>>>> [...]
>>>>>     
>>>>>         
>>>> I prefer option one, too, as
>>>> - it catches all global variables, not just the used ones. We want to be
>>>> sure that no such code sneaks in even if it's not used.
>>>> - it provides a clear error message on what is wrong, inszead of the
>>>> more cryptic one saying that a variable is defined in a discarded section.
>>>>   
>>>>       
>>> Should we move some of the section checking of v3 to v4 as well? I will
>>> soon have a bit more free time and plan to get up to speed on coreboot
>>> development again.
>>>     
>> util/sectionchecker/sectionchecker ?
>>
>> Looks nice. I think this might be a way to go.
>>
>> What are the advantages over the two suggestions above?
>>   
> Quoting from that file:
> # This program checks whether a given list of files ($3+) has any writable
> # and allocatable non-empty sections. If so, the name of the file, the
> name of
> # the section and the symbols in that section are printed and an error is
> # returned.
>
> Given that the code already exists and worked well back then, it might
> be a good starting point.
> The sectionchecker is not a ldscript and that might make it more
> attractive for some people.

Yes, I like that part about it, too...

The only downside I see is that it does a lot of shell stuff which will
slow things down on Windows significantly. (And the folks that ran into
the problem to begin with were on Windows afaict) ...
It might not matter however, since no problems we had solve in this
project so far require an almost correct answer in shorter time. After
all we're not running from lions.

I like the approach, but I would like to hear some opinions from the
Windows using folks

Stefan


-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.dehttp://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866





More information about the coreboot mailing list