This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [MIPS] fix CRT_CALL_STATIC_FUNCTION macro
- From: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- To: Petar Jovanovic <petar dot jovanovic at rt-rk dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Petar Jovanovic <Petar dot Jovanovic at imgtec dot com>
- Date: Thu, 22 Jan 2015 08:35:44 +0000
- Subject: RE: [MIPS] fix CRT_CALL_STATIC_FUNCTION macro
- Authentication-results: sourceware.org; auth=none
- References: <001501d035e2$72edea20$58c9be60$ at rt-rk dot com>
> This is a follow-up to a change [1] in glibc. It fixes the issue [2]
> when jal can not reach a target in different region.
>
> It has been tested with DejaGnu for mips32/o32, mips64/n32 and
> mips64/n64.
>
> Let me know what you think.
So to confirm, the issue is non-pic crt calling an init routine beyond
the current 256 MB region?
Otherwise for PIC the issue is dealt with by the assembler with the
JAL <sym> being expanded to a load from the got and indirect call through
t9. Previously t9 would not have been set up for the callee if the code
was built non-pic (as it would just use a JAL). That would have made
the setup of gp somewhat pointless in the CRT_CALL_STATIC_FUNCTION
code. I am therefore a little confused by the existing code that sets
up GP but then it seemingly is not used unless built for PIC.
I need a little time to consider this further. Catherine may comment in
the meantime.
Thanks,
Matthew