[OpenBIOS] Q: How to "squeeze" C functions in between two symbols?

Blue Swirl blauwirbel at gmail.com
Sat Oct 16 19:34:47 CEST 2010

On Sat, Oct 16, 2010 at 5:18 PM, Andreas Färber <andreas.faerber at web.de> wrote:
> Am 16.10.2010 um 13:43 schrieb Andreas Färber:
>> Am 14.10.2010 um 18:45 schrieb Mark Cave-Ayland:
>>> Andreas Färber wrote:
>>>> I got OpenBIOS to load my RTAS blob and AIX to enter my RTAS C function
>>>> and emit something to escc uart from there. It looks like AIX is trying to
>>>> emit "\nAIX " via display-character RTAS calls.
>>>> My code's not very stable though, the same code snippet didn't work
>>>> inside a [{static,inline}] serial_putchar() function but did directly in my
>>>> main function called from assembly. Still poking at ldscript and assembler
>>>> to find the cause or a workaround. Right now it does print okay but hangs on
>>>> returning from the RTAS call. Will post an RFC once I've cleaned it up a
>>>> little, maybe it's something obvious...
>>>> Andreas
>>> I don't know if it helps with PPC, but on SPARC64 there is an issue
>>> whereby if you are compiling with -O0 (which is typical during development),
>>> you need to allow extra stack space when switching contexts. Does compiling
>>> with -Os solve the issue at all?
>> Seems like it was compiling with -Os by default.
> Update: I've been successful with the combination of -lgcc link and
> rtas-tokens.c compilation with -O2 -fpie (-O2 solved the _savegpr_31 issue).
> The _GLOBAL_OFFSET_TABLE_ issue remains though, I've been extending the
> rtas-ldscript without success so far.

Perhaps the flag is missing somewhere, like linker flags?

More information about the OpenBIOS mailing list