Path: chuka.playstation.co.uk!news From: gil@snsys.com (Gil Jaysmith) Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: Optimise Problem - trunced data Date: Thu, 07 Aug 1997 16:08:07 GMT Organization: SN Systems Lines: 18 Message-ID: <5scri7$oj11@chuka.playstation.co.uk> References: <333d7fd9.23907964@news.playstation.co.uk> <33424023.72C4@interactive.sony.com> <33D5B732.3AC9@dial.pipex.com> <01bc9c44$3fe961e0$ca2c9ac2@martin.snsys.com> <33E39782.6C3F@dial.pipex.com> <01bca0db$fb8dfdc0$ca2c9ac2@martin.snsys.com> <33E8377F.366F@dial.pipex.com> <5s9g9e$oj8@chuka.playstation.co.uk> <33E98CFC.522B@dial.pipex.com> Reply-To: gil@snsys.com NNTP-Posting-Host: gil.snsys.com X-Newsreader: Forte Free Agent 1.0.82 Chris Chadwick wrote: >I wondered why the GP register was set to point to the *middle* and >indexed with a signed offset instead of simply pointing to the base >and using an unsigned offset. I didn't realize this section was >shared! I guess, then, negative offsets index into .sdata and positive >offsets index into .sbss (or vice versa)... Not necessarily the middle... the total size of .sdata and .sbss is limited to 64K, so (assuming .sdata and .sbss occur in that order) the startup code can set GP to .sdata + 32768. So if you have really small .sdata and .sbss sections, all the offsets created by the linker will be sizeable and negative. Gil Jaysmith SN Systems Software Ltd, makers of Psy-Q... http://www.snsys.com Disclaimer: What I say when I post here represents me, not my employers.