Comments on: Handcrafting object files https://briksoftware.com/blog/archives/145 Thu, 14 Jun 2012 18:56:48 +0000 hourly 1 https://wordpress.org/?v=4.7 By: Karsten https://briksoftware.com/blog/archives/145/comment-page-1#comment-16199 Fri, 01 Oct 2010 06:43:04 +0000 https://briksoftware.com/blog/?p=145#comment-16199 awesome info, thanks!

]]>
By: ken https://briksoftware.com/blog/archives/145/comment-page-1#comment-16198 Thu, 30 Sep 2010 22:21:48 +0000 https://briksoftware.com/blog/?p=145#comment-16198 Try ‘man getsectdata’ for the suite of functions. It returns the data and the size.

]]>
By: Karsten https://briksoftware.com/blog/archives/145/comment-page-1#comment-16197 Thu, 30 Sep 2010 05:35:05 +0000 https://briksoftware.com/blog/?p=145#comment-16197 good point, but how do you set a veriable to the start of a section? Isn’t that involving some mach-api stuff? Same goes with the size of the segment. How do you easily get the size of that segment?

]]>
By: ken https://briksoftware.com/blog/archives/145/comment-page-1#comment-16195 Wed, 29 Sep 2010 20:56:23 +0000 https://briksoftware.com/blog/?p=145#comment-16195 Another thing you can do is tack on a binary file as a mach segment using a linker argument.

See http://stackoverflow.com/questions/1604673/how-do-i-embed-data-into-a-mac-os-x-mach-o-binary-files-text-section/1605237#1605237

]]>
By: Marko https://briksoftware.com/blog/archives/145/comment-page-1#comment-16194 Wed, 29 Sep 2010 08:19:59 +0000 https://briksoftware.com/blog/?p=145#comment-16194 If your goal is simply to create an object file which contains a reserved location where you can put the data, couldn’t you simply create a c file with a global initialized char array so that you can reserve the space in the .data section without having to fiddle with as?

char data[1024*1024*100] = {1};

will create a 100Mb object file.

]]>
By: Karsten https://briksoftware.com/blog/archives/145/comment-page-1#comment-16193 Wed, 29 Sep 2010 08:12:59 +0000 https://briksoftware.com/blog/?p=145#comment-16193 ha, nice find… didn’t see this directive. I think that could remove the need to search/replace the bytes manually. thanks a lot!

]]>
By: Paul https://briksoftware.com/blog/archives/145/comment-page-1#comment-16192 Wed, 29 Sep 2010 07:17:45 +0000 https://briksoftware.com/blog/?p=145#comment-16192 Ermmm, can you use the incbin directive in an asm file?

]]>