Displaying 6 results from an estimated 6 matches for "prefix_v".
Did you mean:
prefix_
2017 Mar 06
4
[BUG Report] -dead_strip, strips prefix data unconditionally on macOS
...in() prefix i32 123 {
; obtain a i32 pointer to the main function.
; the prefix data is right before that pointer.
%main = bitcast i32 ()* @main to i32*
; use the gep, to cmpute the start of the prefix data.
%prefix_ptr = getelementptr inbounds i32, i32* %main, i32 -1
; and load it.
%prefix_val = load i32, i32* %prefix_ptr
; print that value.
%ret = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str2, i32 0, i32 0), i32 %prefix_val)
; similarly let's do the same with the global x.
%1 = alloca i32, align 4
store i32 0, i32* %1, align 4
%2...
2017 Mar 07
2
[BUG Report] -dead_strip, strips prefix data unconditionally on macOS
...in to %struct.prefix*), i32 -1, i32 0)
> >
> > declare i32 @printf(i8*, ...)
> >
> > define i32 @main() prefix %struct.prefix { i32 123 } {
> > %main = bitcast i32 ()* @main to i32*
> > %prefix_ptr = getelementptr inbounds i32, i32* %main, i32 -1
> > %prefix_val = load i32, i32* %prefix_ptr
> > %ret = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x
> i8], [8 x i8]* @.str, i32 0, i32 0), i32 %prefix_val)
> > ret i32 0
> > }
> >
> >
> > generates the following for me:
> >
> > .sect...
2017 Mar 07
4
[BUG Report] -dead_strip, strips prefix data unconditionally on macOS
...t.prefix*
> bitcast (i32 ()* @main to %struct.prefix*), i32 -1, i32 0)
>
> declare i32 @printf(i8*, ...)
>
> define i32 @main() prefix %struct.prefix { i32 123 } {
> %main = bitcast i32 ()* @main to i32*
> %prefix_ptr = getelementptr inbounds i32, i32* %main, i32 -1
> %prefix_val = load i32, i32* %prefix_ptr
> %ret = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8],
> [8 x i8]* @.str, i32 0, i32 0), i32 %prefix_val)
> ret i32 0
> }
>
>
> generates the following for me:
>
> .section __TEXT,__text,regular,pure_in...
2017 Mar 07
2
[BUG Report] -dead_strip, strips prefix data unconditionally on macOS
...> > ; the prefix data is right before that pointer.
> > %main = bitcast i32 ()* @main to i32*
> >
> > ; use the gep, to cmpute the start of the prefix data.
> > %prefix_ptr = getelementptr inbounds i32, i32* %main, i32 -1
> > ; and load it.
> > %prefix_val = load i32, i32* %prefix_ptr
> >
> > ; print that value.
> > %ret = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x
> i8], [8 x i8]* @.str2, i32 0, i32 0), i32 %prefix_val)
> >
> > ; similarly let's do the same with the global x.
> >...
2017 Mar 06
6
[BUG Report] -dead_strip, strips prefix data unconditionally on macOS
...ction.
>> ; the prefix data is right before that pointer.
>> %main = bitcast i32 ()* @main to i32*
>>
>> ; use the gep, to cmpute the start of the prefix data.
>> %prefix_ptr = getelementptr inbounds i32, i32* %main, i32 -1
>> ; and load it.
>> %prefix_val = load i32, i32* %prefix_ptr
>>
>> ; print that value.
>> %ret = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x
>> i8], [8 x i8]* @.str2, i32 0, i32 0), i32 %prefix_val)
>>
>> ; similarly let's do the same with the global x.
>> %...
2017 Mar 07
2
[BUG Report] -dead_strip, strips prefix data unconditionally on macOS
...i32 pointer to the main function.
> ; the prefix data is right before that pointer.
> %main = bitcast i32 ()* @main to i32*
>
> ; use the gep, to cmpute the start of the prefix data.
> %prefix_ptr = getelementptr inbounds i32, i32* %main, i32 -1
> ; and load it.
> %prefix_val = load i32, i32* %prefix_ptr
>
> ; print that value.
> %ret = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str2, i32 0, i32 0), i32 %prefix_val)
>
> ; similarly let's do the same with the global x.
> %1 = alloca i32, align 4
>...