[rfc][patch] Refactoring how we handle symbols for the end of sections

Frédéric Riss friss at apple.com
Tue Mar 17 14:23:13 PDT 2015


> On Mar 16, 2015, at 5:33 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
> Fred, your patch is correct since we were always calling
> emitLabelOffsetDifference with the same symbol, so it was computing
> (L+C)-L.

I knew that this patch was correct, because AFAICS MC always will simplify the expression (it could have made sense to generate something like that if it could generate some kind of relocation). My broader question while investigating this was about the meaning of the doesDwarfUseRelocationsAcrossSections() predicate. It only returns true on Darwin, but I was wondering if it had a more precise semantic about where to generate relocations and where not to. Because there are quite a few places in the debug info generation where we could totally avoid creating MC symbols or expressions when on Darwin. For example the dwarf string table doesn’t need a MCSymbol per string in that case.

> I just reused the Addr variables and added a test which checking it.
> 
> Feel free to commit.

I’ll be out of work for a few weeks for (happy) family reasons, thus I’ll gladly delegate that to Duncan or you.

Fred

> Cheers,
> Rafael
> <t.patch>





More information about the llvm-commits mailing list