[PATCH] [x86_64] Don't truncate PC-relative relocations in ELF EH frames to 32 bits

Eric Christopher echristo at gmail.com
Mon Nov 3 18:23:42 PST 2014


Since we always have an augmentation that contains "R" the value of the initial_location field in the FDE should be encoded as the eh_frame_hdr section which, as far as I can tell, is pcrel | sdata4 irrespective of code model. (Also, the dwarf bits for mips for FDECFIEncoding look weird and are likely broken).

The data itself should be encoded as the PE pointer that Joerg mentioned and it should be as we've got it.

Yes this seems wonky.

What's going on in practice is that gcc (our canonical reference for svr4 amd64 abi ... for better or worse) is emitting using the encoding of the rest of the fde section here which is going to be the same as the personality encoding and the linker creates a header that says something else.

I think we're going to be ok with using the personality routine encoding here. However, I'd prefer this code be rewritten to use just an fde encoding, personality encoding, and lsda encoding rather than having a 4th encoding that just copies another one.

All of this aside, the JIT could also use static code generation and then just use absptr for the encodings as well :)

-eric

http://reviews.llvm.org/D6079






More information about the llvm-commits mailing list