Resending the previous message in a plain text format. > -------- Original Message -------- > Subject: RE: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro > Date: Thursday, April 16, 2015 10:38 PM CEST > From: "Moore, Catherine" <catherine_mo...@mentor.com> > To: "Maciej W. Rozycki" <ma...@linux-mips.org>, Petar > Jovanovic<petar.jovano...@rt-rk.com> > CC: 'Matthew Fortune' <matthew.fort...@imgtec.com>, > "gcc-patches@gcc.gnu.org"<gcc-patches@gcc.gnu.org> > References: > <003e01d04179$ccc38bc0$664aa340$@rt-rk.com><6d39441bf12ef246a7abce6654b0235320fca...@lemail01.le.imgtec.org><000201d04723$f69b1350$e3d139f0$@rt-rk.com><000501d07865$e26f2830$a74d7890$@rt-rk.com> > Hi Petar, > It looks like I answered a little too quickly the first time around. I'm > sorry. > In any case, Maciej is correct. I think a link-time test should do it. > Thanks, > Catherine > > > You'd need `objdump' for doing that and there is no ready-to-use solution > > within the GCC test suite available, you'd have to cook something up > > yourself, perhaps starting with `[find_binutils_prog objdump]'. > > > > Another solution might be using an auxiliary linker script (`-Wl,-T,...' > > or maybe just an implicit linker script will do; see the LD manual for > > details) to place the sections the jump is made between apart manually at > > addresses appropriate for JAL to fail. They span does not have to be large > > -- > > when placed correctly, even `JAL .' can jump to the wrong place, which is > > what LD is supposed to catch as a relocation error -- so a test executable > > successfully linked with your correction in place won't be large, it doesn't > > have to take more than 2 virtual pages. > > > > The downside of the latter solution are possible portability issues with the > > linker script. You won't have to run your executable AFAICT from glibc BZ > > #17601 as you'll get a link error if a jump target is out of range. So you > > could > > make it a mere link test, no need to run it. > > > > Maciej > >
Hi Maciej, Catherine, This issue will not trigger a linker error (I believe it treats the symbol referred by the relocation as a local symbol). This is a follow up to GLIBC BZ #17601, the problem is seen only at runtime. So, I think this brings back the need to run the test. I can look into separating sections with -Wl,-T.. (that may also require extending mips_option_groups in mips/mips.exp), if running executable is OK. Regards, Petar