Path: chuka.playstation.co.uk!chuka.playstation.co.uk!news From: gil@snsys.com (Gil Jaysmith) Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: Linker error - assembly problem? Date: Mon, 22 Sep 1997 18:31:02 GMT Organization: SN Systems Lines: 30 Message-ID: <606dbb$5329@emeka.playstation.co.uk> References: <342698CC.3E24@mudhole.spodnet.uk.com> Reply-To: gil@snsys.com NNTP-Posting-Host: gil.snsys.com X-Newsreader: Forte Free Agent 1.0.82 Majik wrote: >Hi, Wotcher squire. > I am having a problem linking an object file created with as and one >with gcc, the linker dies with an error like 'relocation truncated - >GPREL ' and it does this for every variable I have tried to >export from the asm file. The fact that it's a GP error makes it sound like you have too much stuff in the .sdata and .sbss sections. The C compiler probably thinks that since the variables are declared as unsigned char* and unsigned long that they should go into the small-data sections, while the assembler has already asserted that they're in .data. The compiler's object file therefore figures it can use GP-relative relocations to link it all together. Try compiling with the -G0 option. >-- Majik - Owner/Curator of the Sinclair Microcomputer Museum >-- Spod in a suitcase - ' Have Compiler, will travel ' >-- http://mudhole.spodnet.uk.com/~majik/ Oh so it's you is it? My game Reptonmania should be in there somewhere... Gil Jaysmith SN Systems Software Ltd (http://www.snsys.com) Disclaimer: the ads are my employers' but the opinions are mine.