[M3devel] [M3commit] CVS Update: cm3

Jay jay.krell at cornell.edu
Wed Dec 31 19:51:42 CET 2008


 > It is not hard to write a linker in Modula-3.
By all means then, do it.> What's hard is making it compatible with existing proprietary linkers > and loaders that are poorly documented and subject to change without > notice.
Good point -- do you want to be able to debug with Visual Studio or cdb/ntsd/windbg?
You are in for more work then.
I don't think it as ever-changing as claimed, but it isn't easy either.
For Windows, you should be able to write the symbols to the .exe or a separate .dbg file, rather than deal with the truly undocumented and changing .pdb file format (there is a third party book that mostly documents it).
 
Do the other systems change a lot?
If you look across a wide range of time, well, then, yeah, you get to handle the various COFF to ELF transitions, and Apple's rewrite every few years (68K => XCOFF/CFM/PEF => MachO).
 
They are also largely unavoidably system specific, so writing it just once won't suffice.
 
You know..you have to learn about and handle object file formats, at least three of them, and executable file formats, again at least three -- ELF, (MS/PE)COFF, and Mach-O.
And then for debugging, there is CodeView, stabs, DWARF, and maybe others.
If you only want gdb, then you can just stick with stabs.
(Other options seem to crash cm3cg -- like when I fiddle around with -g vs. -ggdb vs. -gstabs.)
 
Or you can just debug with printf and have no symbols...ugh...
 
 
 - Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20081231/c991fb74/attachment-0002.html>


More information about the M3devel mailing list