[patch] Fix pr24486

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 07:11:56 PDT 2015


I just realized that this is not enough. The issues is that when using
the asm streamer we still have to make sure that in

a:
b = a

b is considered defined.

It might be possible to do this in two ways:

* Have the asm streamer use dummy fragments.
* Instead of saving the section or fragment of a symbol, save the base
symbol if any (for b it is a). Without the first change this would
require an extra bit in MCSymbol and I am not sure that we have it.

I will not have the time to work on it any time soon. Maxin, can you
give it a try?

Cheers,
Rafael



On 20 August 2015 at 21:33, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> The attached patch fixes pr24486.
>
> It extends the work done in r233995 so that now getFragment (in
> addition to getSection) also works for variable symbols.
>
> With that the existing logic to decide if a-b can be computed works
> and the expression evaluation can avoid expanding variables as
> aggressively. That in turn lets the relocation code see the original
> variable.
>
> I think the testcase change to COFF is OK. Both relocations mean
> exactly the same. In fact, gas produces relocations with the .text
> symbol like we do for ELF. We should probably just implement that for
> COFF some day.
>
> Cheers,
> Rafael


More information about the llvm-commits mailing list