This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DSO: pc relative symbol address


kum <a.kumaresh@gmail.com> writes:

> There are no direct invocation of my_foo1. What prevents the compiler
> from emitting a PC relative address to store in my_foo? Something like
>   lw $2, PC - <offset>

You need to get the address of my_foo1 into $2.  Using a PC relative
value only works if your processor has a PC-relative load instruction.
Not all processors have such an instruction.  If your processor has
one and gcc is not using it, then this may be a bug.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]