This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC][GOLD] ARM: Add cantunwind when unwind info does not match start of section
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Yury Usishchev <y dot usishchev at samsung dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 11 Feb 2016 15:51:50 -0800
- Subject: Re: [RFC][GOLD] ARM: Add cantunwind when unwind info does not match start of section
- Authentication-results: sourceware.org; auth=none
- References: <87si0zcudv dot fsf at samsung dot com> <87oabncu8c dot fsf at samsung dot com>
>> 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