On 12/05/13 12:19 PM, Philipp Klaus Krause wrote:
> On 12.05.2013 17:54, Claude Sylvain wrote:
>>
>> On 12/05/13 11:31 AM, Philipp Klaus Krause wrote:
>>
>> >
>> > On 12.05.2013 17:01, Claude Sylvain wrote:
>> >
>> >>
>> >> - I use SDCC on Cygwin 1.7.x
>> >> - I use SDCC to built Z80 programs.
>> >>
>> >> - I have successfully built SDCC 3.3.0 RC2 from source on Cygwin.
>> >>
>> >> - However, when building a Z80 program, I noticed the following
>> >> problem:
>> >>
>> >> - SDCC put "s__INITIALIZER" section (that hold some code)
>> >> in the "_DATA" section (RAM located @ 0x8000
>> >> for the target I use).
>> >>
>> >> - I think this is a bug, because sections that hold code
>> >> must be put in the "_CODE" section. Not in the
>> >> "_DATA" section.
>> >>
>> >> - This bug was not there in SDCC 3.2.0.
>> >> Also, in SDCC 3.2.0, there is no "s__INITIALIZER" section.
>> >>
>> >>
>> >> From a SDCC user.
>> >>
>> >> Claude
>> >
>> > Do you use a custom crt0.rel?
>> >
>>
>> - Yes, I use a custom "crt0".
>>
>> - Do I have to update my custom "crt0", using some new
>> "ctr0" template found in SDCC ?
>>
>
>
> Yes. The INITIALIZER / INITIALIZED mechanism is the new (sdcc 3.3.0) way
> to initialize global variables. It is much faster and smaller than what
> we did before. However the crt0 needs to do the copy from INITIALIZER to
> INITIALIZED.
>
> In sdcc, an example crt0 can be found at device/lib/z80/crt0.s
>
- Well, I found a "crt0.s" in the following directory:
sdcc/share/sdcc/lib/src/z80
- I updated my "crt0" using the generic "crt0.s" found at location
mentioned above.
When building the updated version of my "crt0", SDCC
complain about the following symbols missing:
l__INITIALIZER
s__INITIALIZED
s__INITIALIZER
So, to resolve this problem I added in my "crt0" the
following lines:
.globl l__INITIALIZER
.globl s__INITIALIZED
.globl s__INITIALIZER
The above mentionned 3 ".globl" are not present in the
generic Z80 "crt0.s".
- Now, SDCC work as expected.
Thank you for your help.
Claude.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user