Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raising strings #21

Closed
deXetrous opened this issue Nov 25, 2018 · 2 comments
Closed

Raising strings #21

deXetrous opened this issue Nov 25, 2018 · 2 comments

Comments

@deXetrous
Copy link

I generated a binary for a C code that involved char * and an assignment to it. When raised using llvm-mctoll, the string constant is not found as a global string and neither the IR has any variables of type i8*. All the variables present are either i64 or i32. Please let me know if this is a bug or the support for it is not yet added.

@bharadwajy
Copy link
Contributor

Thanks for the report. This is a known limitation.

Work is ongoing to identify memory accesses and the types of accessed data to abstract them as LLVM variables as appropriate.

@aaronsm
Copy link
Contributor

aaronsm commented Jul 11, 2019

Strings are supported now. If you are still having problems let us know.

$ cat string.c

#include <stdio.h>
char str1[]="my string";
int main() {
printf("%s\n", str1);
}

$ gcc -O2 string.c
$ ./a.out
my string
$ llvm-mctoll a.out
cat a.out-dis.ll

; ModuleID = 'a.out'
source_filename = "a.out"

@RO-String = private constant [10 x i8] c"my string\00", align 1

define dso_local void @main() {
entry:
%0 = bitcast [10 x i8]* @RO-String to i8*
%1 = tail call i32 @puts(i8* %0)
ret void
}

declare dso_local i32 @puts(i8*)

@aaronsm aaronsm closed this as completed Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants