On Mon, Jan 14, 2013 at 2:00 AM, Thomas Baier <ba...@microsys.de> wrote: > Dear list, > > I've just subscribed to the list and I hope this is the right place for > the following question. > > The operating system I'd like to use gcc for (OS-9, for the curious) > requires an ABI, where global variables are only accessed through > register indirect addressing. On the powerpc platform, r2 is used for > indirect addressing. There is already a feature in gcc which can use > register indirect addressing for the powerpc target for global variables > using a special small data area, but unfortunately this is not enough. > > Currently I'm a bit lost in where to start reading to get an idea how I > could add this new ABI to gcc. Can you please point me to some reading > or maybe even share some ideas how this could be accomplished?
What do you mean by register indirect addressing? Not register plus displacement or register plus register? PowerPC only supports loading from an immediate value for a 16KB range around 0. Otherwise, all addresses are constructed at least partially in a register. If you are trying to say that you are encountering a problem because you are running out of space due to the limited size of the TOC -- with or without section anchors -- then, as Peter mentioned, you should look at the support for cmodel=large, which allows a two instruction sequence for 32 bit offsets into the TOC instead of the original 16 bit displacement. cmodel=medium sometimes directly accesses the data area from the r2 base pointer, which may violate the OS-9 ABI requirements. Thanks, David