Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Placing Segments

41 views
Skip to first unread message

Markus Knecht

unread,
Apr 22, 2013, 2:12:22 AM4/22/13
to
I'm writting a backend for lccat the moments and i've come across a problem i need to solve. Is their any way to force lcc to place the segment in another order then it does it normally? I need the BSS segment to be placed before the CODE segment instead of after it.

Kind Regards
Markus Knecht

Markus Knecht

unread,
May 6, 2013, 3:28:12 AM5/6/13
to
At the moment I copy the Segments around by myself for each compiled file, but I do not think that is the Solution. Is their really Nothing I can do, so that the lcc places them in the Order I need them? For your Information: I do not create Assembler Code (the Architecture is a bit special), so I can not just reorder the Segments their and I would not like to inject another process in the chain just to make this reordering, but if their is no other solution I probably had to.

Kind Regards

Markus Knecht

jacob navia

unread,
May 6, 2013, 5:09:57 AM5/6/13
to
There is no way to do it in lcc as it is now since all the code is
emitted as soon as it is generated.

I had to change that to implement the C99 initialization specifications,
and the
only way was to output everything into RAM, and then make another pass
through the instructions emitting what I needed in the order I needed.


Markus Knecht

unread,
May 7, 2013, 4:22:39 AM5/7/13
to
So if I understand this right, then in the Forest(or the List of Trees) which represents the hole Code, the Trees of the CODE Segment are placed before the Trees of the BSS Segment. Would it be possible to change the Order in the Forest befor Code is generated from it.

Then Somewhere this explicit reordering have been done. In the C File the Order is correct, all the Initialized & Uninitialized Variables came before the Function Implementation, which uses them, What is excactly what I need, but lcc places the BSS (Uninitialized Variables) after the CODE (Function Implementations).
0 new messages