cirosantilli.github.io icon indicating copy to clipboard operation
cirosantilli.github.io copied to clipboard

How to define Absolute section in routine

Open JamesXie123 opened this issue 8 years ago • 4 comments

Hi I tried to use the "objcopy" utility copies the contents of a picture to an object file as follow : screenshot from 2017-06-27 12-18-33

From the picture , we could see the "_binary_image_jpg_size" symbol is Absolute . And My question is that : How to define Absolute section in our routine . I searched on Google, but I found no useful information .

JamesXie123 avatar Jun 28 '17 03:06 JamesXie123

Hi James,

For questions that are not specific to my repositories like this, please ask on stack overflow.

objdump and objcopy only work on executable files like ELF, not on PNG images! :-)

Maybe you are confusing PNG images with disk images, which can be booted from?

I recommend the following:

  • start with easier tasks than OS programming
  • study English without stop ;-)

cirosantilli avatar Jun 28 '17 17:06 cirosantilli

This is the description for the "objcopy" command's option "--binary-architecture=bfdarch " : --binary-architecture=bfdarch Useful when transforming a raw binary input file into an object file. In this case the output architecture can be set to bfdarch. This option will be ignored if the input file has a known bfdarch. You can access this binary data inside a program by referencing the special symbols that are created by the conversion process. These symbols are called _binary_objfile_start, _binary_objfile_end and _binary_objfile_size. e.g. you can transform a picture file into an object file and then access it in your code using these symbols.

screenshot from 2017-06-29 09-01-41

who tell you the objdump and objcopy could only work on the executable files ?????

Please read the help documents of the commands seriously before answerd the question .

BTW , I have been a programmer about 10 years . Of course I know what a PNG file is !!!!!!

JamesXie123 avatar Jun 29 '17 01:06 JamesXie123

This is the description for the "objcopy" command's option "--binary-architecture=bfdarch " : --binary-architecture=bfdarch Useful when transforming a raw binary input file into an object file. In this case the output architecture can be set to bfdarch. This option will be ignored if the input file has a known bfdarch. You can access this binary data inside a program by referencing the special symbols that are created by the conversion process. These symbols are called _binary_objfile_start, _binary_objfile_end and _binary_objfile_size. e.g. you can transform a picture file into an object file and then access it in your code using these symbols.

[image: screenshot from 2017-06-29 09-01-41] https://user-images.githubusercontent.com/15681200/27666964-054aa3fe-5caa-11e7-8f50-b62b8ca75b61.png

who tell you the objdump and objcopy could only work on the executable files ?????

Please read the help documents of the commands seriously before answerd the question .

BTW , I have been a programmer about 10 years . Of course I know what a PNG file is !!!!!!

2017-06-29 1:49 GMT+08:00 cirosantilli [email protected]:

Hi James,

For questions that are not specific to my repositories like this, please ask on stack overflow.

objdump and objcopy only work on executable files like ELF, not on PNG images! :-)

Maybe you are confusing PNG images with disk images, which can be booted from?

I recommend the following:

  • start with easier tasks than OS programming
  • study English without stop ;-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cirosantilli/chat/issues/28#issuecomment-311736324, or mute the thread https://github.com/notifications/unsubscribe-auth/AO9GsINDBrJ7-ZcSFKXgN8ILsdZfGChOks5sIpITgaJpZM4OHcI3 .

JamesXie123 avatar Jun 29 '17 01:06 JamesXie123

Hi James, sorry for the misunderstanding. Take it easy.

Ask on stackoverflow.

Give more context: what do you want o accomplish? Why a png?

cirosantilli avatar Jun 29 '17 07:06 cirosantilli