This is the mail archive of the gcc-patches@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: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro


On Thu, 16 Apr 2015, Petar Jovanovic wrote:

> > There isn't any need to execute a large testcase.  Instead, try adding a
> short version of your test to the directory gcc/testsuite/gcc.target/mips.
> > There are examples of other tests there they check for specific assembler
> sequences by using scan-assembler.   See umips-swp-1.c (and others) for a
> specific example of how to do this.
> > Let me know if you need additional help.
> > Thanks,
> > Catherine
> 
> Hi Catherine,
> 
> Sorry for late response, I have missed to follow up on this.
> IIUC, scan-assembler will scan assembly file generated from a test file.
> This particular change will - on the other hand - modify crtend.o and thus
> init section. Is there a 'scan-assembler' functionality over a final linked
> executable, as that would actually test the change?

 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


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