如何指定 sde-objcopy 的架构?
我需要使用 sde-objcopy 将图片转换为目标文件(.o),然后我可以在我们的无操作系统系统中使用这张图片。 我测试了 objcopy 命令,它在我的 PC(Fedora 12)上运行良好。例如,下面的命令会将 test.jpg 转换为 test.o。
objcopy -I binary -O elf32-i386 -B i386 ../stdy/test.jpg test.o
这是我的问题:
A。 sde-objcopy 没有“-B”选项来指定体系结构,但如果我不指定体系结构,它将响应如下警告:
$ sde-objcopy -I binary -O elf32- Little test.jpg test.o
sde-objcopy:警告:输出文件不能代表未知的架构!
如何解决这个警告?
B。看来 objcopy 使用文件名在目标文件中生成符号。如果我使用完整路径(例如/home/owner/stdy/test.jpg
)作为objcopy的参数,它将生成长命名符号。有没有优雅的方法来解决这个问题?
$ objcopy -I 二进制 -O elf32-i386 -B i386 ../stdy/test.jpg test.o
$ nm test.o
00000083 D _binary____stdy_test_jpg_end
00000083 A _binary____stdy_test_jpg_size
00000000 D _binary____stdy_test_jpg_start
$ objcopy -I binary -O elf32-i386 -B i386 test.jpg test.o
$ nm test.o
00000032 D _binary_test_jpg_end
00000032 A _binary_test_jpg_size
00000000 D _binary_test_jpg_start
I need to convert an picture to an object file(.o) use sde-objcopy, then I can use this picture in our no-os system.
I had test the objcopy command, it works well on my PC(Fedora 12). For example, the command below will convert test.jpg to test.o.
objcopy -I binary -O elf32-i386 -B i386 ../stdy/test.jpg test.o
Here are my questions:
A. sde-objcopy doesn't has the "-B" option to specify the architecture, but if I don't specify a architecture, it will reponse an warning like this:
$ sde-objcopy -I binary -O elf32-little test.jpg test.o
sde-objcopy: Warning: Output file cannot represent architecture UNKNOWN!
How to fix this warning?
B. It seems that objcopy uses the file's name to generate symbols in the object file. If I use the full path(such as /home/owner/stdy/test.jpg
) as the parameter of objcopy, it will generate long named symbols. Is there any elegant method to fix this issue?
$ objcopy -I binary -O elf32-i386 -B i386 ../stdy/test.jpg test.o
$ nm test.o
00000083 D _binary____stdy_test_jpg_end
00000083 A _binary____stdy_test_jpg_size
00000000 D _binary____stdy_test_jpg_start
$ objcopy -I binary -O elf32-i386 -B i386 test.jpg test.o
$ nm test.o
00000032 D _binary_test_jpg_end
00000032 A _binary_test_jpg_size
00000000 D _binary_test_jpg_start
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用类似的内容:
然后访问程序中的内容:
You could use something like:
and then access the stuff in your program: