This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RISC-V problem with weak function references and -mcmodel=medany
Hello Jim,
----- Am 29. Mai 2018 um 20:27 schrieb Jim Wilson jimw@sifive.com:
> On 05/28/2018 06:32 AM, Sebastian Huber wrote:
>> I guess, that the resolution of the weak reference to the undefined
>> symbol __deregister_frame_info somehow sets __deregister_frame_info to
>> the absolute address 0 which is illegal in the following "call
>> __deregister_frame_info"? Is this construct with weak references and a
>> -mcmodel=medany supported on RISC-V at all?
>
> Yes. It works for me. Given a simple testcase
>
> extern void *__deregister_frame_info (const void *)
> __attribute__ ((weak));
> void * foo;
> int
> main (void)
> {
> if (__deregister_frame_info)
> __deregister_frame_info (foo);
> return 0;
> }
>
> and compiling with -mcmodel=medany -O -Ttext=0x80000000, I get
would you mind trying this with -Ttext=0x90000000?
Please have a look at:
https://sourceware.org/bugzilla/show_bug.cgi?id=23244
https://sourceware.org/ml/binutils/2018-05/msg00296.html