[llvm-dev] Got stuck with PC-rel branching

Peter Bel via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 25 09:02:36 PST 2017


Big thanks, i've managed to find what's going on. The thing that dumbfolded
me a couple of times was that the error was thrown in one of the
MCAssembler methods, but never in applyFixup() itself.

On Thu, Jan 19, 2017 at 8:46 PM, Friedman, Eli <efriedma at codeaurora.org>
wrote:

> On 1/19/2017 10:21 AM, Peter Bel wrote:
>
>> Hi,
>>
>> For the function call - yes, probably. But what about branching inside
>> one function (standard if-then for example)?
>>
>> For example:
>> echo "int g() { int a = 1; if (a > 3) return 1; return 0; }" | clang -x c
>> - -o /tmp/a.o -c && objdump -d /tmp/a.o
>>
>
> Yes, the assembler tries to avoid emitting relocations for relative
> offsets within a section.  See MCAssembler::layout, particularly the bit at
> the end where it calls applyFixup().
>
>
> -Eli
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170125/d585f8ed/attachment.html>


More information about the llvm-dev mailing list