[PATCH] [mips64] Add support for MCJIT for MIPS64

Vladimir Stefanovic vladimir.stefanovic at imgtec.com
Wed Nov 5 11:41:21 PST 2014


Hi Lang, thanks for the review.

Mips64 may have three relocations packed into one relocation record, where the result of one relocation is used as the addend for the next one, and they must be resolved in the order they appear.
The current code first resolves external symbols, so for mips64 this order would be broken.

E.g.:

000000000000000c R_MIPS_GPREL16    main
000000000000000c R_MIPS_SUB        *ABS*
000000000000000c R_MIPS_HI16       *ABS*

The first relocation would be added to the Relocations, and the next two to the ExternalSymbolRelocations. Instead of using these two maps, we added a different container, one for all symbols (Mips64Relocations), with section id and RelocationEntry pairs. But then external symbols' name gets lost, and that's why we added a SymbolName field in the RelocationEntry.

For the IsLocal - a mips64 GOT entry for local symbols contains only high 16 bits of the symbol address, so we added this field to keep the track whether the symbol is local.

Regards,
Vladimir

http://reviews.llvm.org/D5913






More information about the llvm-commits mailing list