[LLVMdev] llvm-gcc

Gordon Keiser gkeiser at arxan.com
Fri Dec 2 15:05:15 PST 2011


I think you would want to do this with objcopy...   something like : 

	objcopy -I binary -O elf32-i386 -B i386 yourimage.jpg yourimage.o

Where the -O and -B options are set correctly for your architecture.   That will create an object file containing the image data and will define the symbols:
	_binary_yourimage_jpg_start
	_binary_yourimage_jpg_end
	_binary_yourimage_jpg_size

You should then be able to pass the .o file in along with your C file and reference it using the above  symbols defined as externs of the proper type. 

-Gordon Keiser
Arxan Technologies


From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Rahil Rahimian
Sent: Friday, December 02, 2011 1:54 PM
To: zhangzuyu; llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] llvm-gcc

I want to pass a input file to foo.c that contains a picture. how can do it?

llvm-gcc -emit-llvm -c foo.c -o foo.bc




More information about the llvm-dev mailing list