[LLVMdev] [PATCH] Symbol offsets
Ben Gamari
bgamari.foss at gmail.com
Sun Jul 20 15:18:18 PDT 2014
Rafael EspĂndola <rafael.espindola at gmail.com> writes:
> Now that aliases can have any expressions, can't you use something like
>
> @data = private global [2 x i32] [i32 42, i32 43]
> @symbol = alias getelementptr ([2 x i32]* @data, i32 0, i32 1)
>
> This produces
>
> .Ldata:
> .long 42 # 0x2a
> .long 43 # 0x2b
> ...
> .globl symbol
> symbol = .Ldata+4
>
> That is, in the object file there is only one symbol (named symbol)
> and it is at offset 4.
>
How would one define the body of the function `symbol` in this case?
Cheers,
- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140720/ce7a33e3/attachment.sig>
More information about the llvm-dev
mailing list