[PATCH] Correct re-applying relocations on MIPS platforms

Kaylor, Andrew andrew.kaylor at intel.com
Wed Jul 24 13:56:26 PDT 2013


I have some concern about your introduction of R_MIPS_UNUSED1 and R_MIPS_UNUSED2.  Are those values really not used in the ABI definition?  Are they specifically defined as reserved for implementation-specific use?

It's not clear to me why you are reading from '*TargetPtr' instead of '*Placeholder'.  Do these relocations operate on the same location or otherwise depend on something written by a prior relocation.  If so, please say so in a comment where the relocation is handled.

Also, it's not entirely clear to me how this handles the situation where the generated code (and the stub along with it) gets moved to a new address.  I think, after puzzling over the code, that it works because the relocation is based on a relative address of two items that will always be moved together, but as I said it isn't entirely clear to me.  Some additional comments explaining how this works would be helpful.

-Andy

-----Original Message-----
From: Petar Jovanovic [mailto:Petar.Jovanovic at imgtec.com] 
Sent: Monday, July 22, 2013 5:31 PM
To: llvm-commits at cs.uiuc.edu
Cc: Kaylor, Andrew; David Tweed
Subject: [PATCH] Correct re-applying relocations on MIPS platforms

Hello everyone,

here is a patch that corrects how multiple relocations are applied on MIPS.

Similar to ARM change r182800, dynamic linker will reads bits/addends from the original object rather than from the object that might have been patched previously. For the purpose of relocations for MCJIT stubs on MIPS, we internally use otherwise unused MIPS relocations.

The change also enables MCJIT unit tests for MIPS (EL/BE), and the following two tests now pass:

- MCJITTest.return_global and
- MCJITTest.multiple_functions.

Regards,
Petar




More information about the llvm-commits mailing list