Whilst looking at ELF X86_64 relocations in LLD, I noticed that MC lacks support for R_X86_64_SIZE{64,32}.
This is an attempt to implement the first one.
I blatantly copied the binutils syntax here, adding the '@SIZE' suffix. I hope it's fine, if there are concerns I'll be happy to discuss.
A patch for R_X86_64_SIZE32 will follow.
Details
Diff Detail
Event Timeline
Seems a little over specific, it would be nice if we could handle R_386_SIZE32 and R_X86_64_SIZE32 as well.
Arg, this feedback isn't very helpful. Sorry about that. I guess what I tried to communicate was that we should have a VK_SIZE instead of VK_X86_64_SIZE and let the fixup's kind govern whether we get `R_X86_64_SIZE32 or `R_X86_64_SIZE64.
Thank for the review. This was my intention actually, and I think your comment is a sign that I chose the wording poorly.
Let me rephrase. It seems to me the format for VK is VK_<$arch | $format >_<$identifier>.
A couple of examples of this are, e.g. VK_Mips_HIGHEST and VK_COFF_IMGREL32
In other words, X86_64 doesn't refer to the size but the target architecture. We can use something else if you have a better proposition.
I am with David. The point is that there are both arch specific and arch independent VK_*. Since there is also R_386_SIZE32 for the x86 arch, this should probably be just VK_SIZE.
lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp | ||
---|---|---|
151 | I would think this should be R_X86_64_SIZE32. |
I would think this should be R_X86_64_SIZE32.