Subject: Re: xview3.2 with shared libs
To: None <f80204@cc.ee.ntu.edu.tw>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: current-users
Date: 11/15/1993 22:17:03
>   I have compiled xview3.2 with shared libs. It seems to work.
> I spent much time to find a 'bug?' which caused textedit to core
> dump when choosing 'Open'. It is due to 'txt_popup.c' passing
> STATIC callback functions to 'file_chooser'. LD/i386 doesn't support
> RELOC_STATICS_THROUGH_GOT_P like LD/sparc. Is it possible to support
> RELOC_STATICS_THROUGH_GOT_P in LD/i386? Maybe Paul Kranenburg knows.
> Now I simply remove these 'static' decl.
> 

The functions in question are in fact ill declared. gcc warns you about this:
"`show_dot_files_proc' was declared `extern' and later `static'" but then it
gets confused about what relocation to emit. The function in fact remains
static, but the relocation record generated for taking this function's address
is in fact one for a global address (ie. a `@GOT' in stead of a `@GOTOFF' in
i386 assembler parlance).

Just fix the source so that all functions are declared properly and your
problems will go away (well, this particular problem anyway).

I once considered adding some sort of consistency check in gas that would
catch this. I'll re-consider it...

-pk


------------------------------------------------------------------------------