On 11/04/2013 11:15 AM, Eric Christopher wrote:> > > > On Mon, Nov 4, 2013 at 11:05 AM, Shankar Easwaran > <shankare at codeaurora.org <mailto:shankare at codeaurora.org>> wrote: > > Hi, > > I was looking at the ARM ABI > docs(http://infocenter.arm.__com/help/topic/com.arm.doc.__ihi0044e/IHI0044E_aaelf.pdf > <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044e/IHI0044E_aaelf.pdf>) > and they mention. > > "A binary file may use REL or RELA relocations or a mixture of the > two (but multiple relocations for the same > address must use only one type)." > > Does LLVM emit rel/rela relocations with ARM ? > > > I hope not. Ew.The only reason this is Ew is that llvm has decided not to prepare for it. There shouldn't be a single rel/rela type for a given output. The one that works for the given situation for the given section should be used. The mechanism for handling both should not be complicated. There are rules about relocation order and multiple relocations can operate on a single point in the binary. There is no reason a section of .rel relocations cannot operate alongside a section of .rela relocations. Unfortunately I believe the single rel/rela type is part and parcel to gnu as well and I have resigned myself to going with the flow for now. Jack> > -eric > > Any tests ? > > Thanks > > Shankar Easwaran > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > hosted by the Linux Foundation > > _________________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/__mailman/listinfo/llvmdev > <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
On Mon, Nov 4, 2013 at 11:40 AM, Jack Carter <jack.carter at imgtec.com> wrote:> On 11/04/2013 11:15 AM, Eric Christopher wrote: > >> >> >> >> On Mon, Nov 4, 2013 at 11:05 AM, Shankar Easwaran >> <shankare at codeaurora.org <mailto:shankare at codeaurora.org>> wrote: >> >> Hi, >> >> I was looking at the ARM ABI >> docs(http://infocenter.arm.__com/help/topic/com.arm.doc.__ >> ihi0044e/IHI0044E_aaelf.pdf >> <http://infocenter.arm.com/help/topic/com.arm.doc. >> ihi0044e/IHI0044E_aaelf.pdf>) >> >> and they mention. >> >> "A binary file may use REL or RELA relocations or a mixture of the >> two (but multiple relocations for the same >> address must use only one type)." >> >> Does LLVM emit rel/rela relocations with ARM ? >> >> >> I hope not. Ew. >> > > The only reason this is Ew is that llvm has decided not to prepare for it. > There shouldn't be a single rel/rela type for a given output. The one that > works for the given situation for the given section should be used. The > mechanism for handling both should not be complicated. > > There are rules about relocation order and multiple relocations can > operate on a single point in the binary. There is no reason a section of > .rel relocations cannot operate alongside a section of .rela relocations. > >True, however, I can think of no reasonable situation that you'd want to do that. RELA has been around long enough that it's the default for just about any ELF platform so the amount of legacy code is just someone not implementing RELA as they should. -eric> Unfortunately I believe the single rel/rela type is part and parcel to gnu > as well and I have resigned myself to going with the flow for now. > > Jack > > >> -eric >> >> Any tests ? >> >> Thanks >> >> Shankar Easwaran >> >> -- >> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, >> hosted by the Linux Foundation >> >> _________________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> >> http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/__mailman/listinfo/llvmdev >> <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >> >> >> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131104/7817f3c0/attachment.html>
On 11/4/2013 1:40 PM, Jack Carter wrote:> On 11/04/2013 11:15 AM, Eric Christopher wrote: >> >> >> >> On Mon, Nov 4, 2013 at 11:05 AM, Shankar Easwaran >> <shankare at codeaurora.org <mailto:shankare at codeaurora.org>> wrote: >> >> Hi, >> >> I was looking at the ARM ABI >> docs(http://infocenter.arm.__com/help/topic/com.arm.doc.__ihi0044e/IHI0044E_aaelf.pdf >> <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044e/IHI0044E_aaelf.pdf>) >> and they mention. >> >> "A binary file may use REL or RELA relocations or a mixture of the >> two (but multiple relocations for the same >> address must use only one type)." >> >> Does LLVM emit rel/rela relocations with ARM ? >> >> >> I hope not. Ew. > > The only reason this is Ew is that llvm has decided not to prepare for > it. There shouldn't be a single rel/rela type for a given output. The > one that works for the given situation for the given section should be > used. The mechanism for handling both should not be complicated. > > There are rules about relocation order and multiple relocations can > operate on a single point in the binary. There is no reason a section > of .rel relocations cannot operate alongside a section of .rela > relocations. >Is there a reason behind this, if the compiler doesit ? anything on performance ? It makes tools that operate on the object files bit rusty. I would have preferred using RELA all over. Thanks Shankar Easwaran
________________________________________> From: Shankar Easwaran [shankare at codeaurora.org] > Sent: Monday, November 04, 2013 11:44 AM > To: Jack Carter; Eric Christopher > Cc: llvmdev Dev > Subject: Re: [ARM] Mixing rel/rela relocations > > On 11/4/2013 1:40 PM, Jack Carter wrote: >> On 11/04/2013 11:15 AM, Eric Christopher wrote: >>> >>> >>> >>> On Mon, Nov 4, 2013 at 11:05 AM, Shankar Easwaran >>> <shankare at codeaurora.org <mailto:shankare at codeaurora.org>> wrote: >>> >>> Hi, >>> >>> I was looking at the ARM ABI >>> docs(http://infocenter.arm.__com/help/topic/com.arm.doc.__ihi0044e/IHI0044E_aaelf.pdf >>> <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044e/IHI0044E_aaelf.pdf>) >>> and they mention. >>> >>> "A binary file may use REL or RELA relocations or a mixture of the >>> two (but multiple relocations for the same >>> address must use only one type)." >>> >>> Does LLVM emit rel/rela relocations with ARM ? >>> >>> >>> I hope not. Ew. >> >> The only reason this is Ew is that llvm has decided not to prepare for >> it. There shouldn't be a single rel/rela type for a given output. The >> one that works for the given situation for the given section should be >> used. The mechanism for handling both should not be complicated. >> >> There are rules about relocation order and multiple relocations can >> operate on a single point in the binary. There is no reason a section >> of .rel relocations cannot operate alongside a section of .rela >> relocations. >> > Is there a reason behind this, if the compiler doesit ? anything on > performance ? It makes tools that operate on the object files bit rusty.History. In the beginning there was REL, thus there is a lot of binaries with REL. Then came along RELA and people didn't want things to break so they allowed both in the same binaries. Besides, RELA is bigger than REL which keeps its addend in the instruction or data point. Size might not be an issue for you, but it is for some. Personally, I don't care which is used and where. I just assume I have to deal with both. It does create somewhat redundant code, but that's life. Jack> I would have preferred using RELA all over.> Thanks> Shankar Easwaran