This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][GOLD] ARM: Add cantunwind when unwind info does not match start of section


>> I want to add one more condition to fix_exidx_coverage. This will wix PR gold/19611.
>> I have a question about condition itself, I need to compare start address of
>> first unwind entry (first_word) to actual start of the section. In bfd I
>> compared it to vma. But as I understand vma of input sections is always zero.
>> So the question is: is it correct to compare first_word to zero (as done
>> in attached patch)?

Sort of. The first word is a relocated value, so if you wanted to be
super-careful, you'd want to look for the relocation and make sure
that it's a reference to the text section symbol + 0. Since ARM uses
REL-style relocations, the addend is embedded in the contents of the
section, so you're really looking at the addend of the relocation. Any
properly-formed EXIDX section should have the right relocation for
that word, so simply checking that the addend is 0 should be fairly
safe.

It doesn't matter what the vma of the input section is. Yes, it's
nearly always 0 for a relocatable file, but even if it wasn't 0, it
wouldn't matter -- the relocation would still point to the text
section symbol with an addend that gives an offset relative to the
start of the section, so you'd still want to look for a value of 0.

+      if (first_word)

When the condition is not a bool, I prefer using "!= 0".

With that change, the patch is OK with me if it's OK with Doug.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]