<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
> It is not hard to write a linker in Modula-3.<BR><BR>
By all means then, do it.<BR><BR>> What's hard is making it compatible with existing proprietary linkers <BR>> and loaders that are poorly documented and subject to change without <BR>> notice.<BR><BR>
Good point -- do you want to be able to debug with Visual Studio or cdb/ntsd/windbg?<BR>
You are in for more work then.<BR>
I don't think it as ever-changing as claimed, but it isn't easy either.<BR>
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).<BR>
<BR>
Do the other systems change a lot?<BR>
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).<BR>
<BR>
They are also largely unavoidably system specific, so writing it just once won't suffice.<BR>
<BR>
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.<BR>
And then for debugging, there is CodeView, stabs, DWARF, and maybe others.<BR>
If you only want gdb, then you can just stick with stabs.<BR>
(Other options seem to crash cm3cg -- like when I fiddle around with -g vs. -ggdb vs. -gstabs.)<BR>
<BR>
Or you can just debug with printf and have no symbols...ugh...<BR>
<BR>
<BR>
- Jay<BR></body>
</html>