Thread overview | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 18, 2003 systems programming | ||||
---|---|---|---|---|
| ||||
i noticed in the DMD documentation that D can be used in systems programming, but it is only mentioned in the introduction, and never expounded on.
for example, i can't find information on setting the start point (as i can with GNU GCC's ld) of an executable, outputting a raw binary at link time, or linking to oject files compiled with a separate assembler.
stuff like that.
am i just not looking hard enough, forgetting something, or has no one ever tried using DMD in a systems context?
if anyone has tried using DMD this way, i'd appreciate knowing about it. :)
--
Charles "grey wolf" Banas
|
March 19, 2003 Re: systems programming | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Banas | "Charles Banas" <greywolf@greyfade.net> wrote in message news:oprl7p2ki78ctebf@news.digitalmars.com... > i noticed in the DMD documentation that D can be used in systems programming, but it is only mentioned in the introduction, and never expounded on. > > for example, i can't find information on setting the start point (as i can with GNU GCC's ld) of an executable, That's a feature of the linker. See www.digitalmars.com/ctg/optlink.html > outputting a raw binary at link time, I don't know what you mean by this. The linker outputs an executable in PE format. > or linking to oject files compiled with a separate assembler. Easy, just specify the .obj files in the command to DMD. |
March 20, 2003 Re: systems programming | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | On Wed, 19 Mar 2003 01:21:06 -0800, Walter <walter@digitalmars.com> wrote: > > That's a feature of the linker. See www.digitalmars.com/ctg/optlink.html > my bad. i forgot DMD used that linker. >> outputting a raw binary at link time, > > I don't know what you mean by this. The linker outputs an executable in PE > format. > GCC's LD refers to it as "bin" format. i honestly don't want to have to go the extra step of stripping a PE. >> or linking to oject files compiled with a separate assembler. > > Easy, just specify the .obj files in the command to DMD. > i'm just not exactly sure what format(s) it expects for the obj files. that, and i've never heard of OMF. (or, more accurately, i've never seen anything that supports it.) -- Charles "grey wolf" Banas |
March 21, 2003 Re: systems programming | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Banas | "Charles Banas" <greywolf@greyfade.net> wrote in message news:oprma8t3z58ctebf@news.digitalmars.com... > >> outputting a raw binary at link time, > > I don't know what you mean by this. The linker outputs an executable in > > PE > > format. > GCC's LD refers to it as "bin" format. i honestly don't want to have to go > the extra step of stripping a PE. The LD "bin" format, if for windows32, is likely a PE (portable executable) file. > >> or linking to oject files compiled with a separate assembler. > > Easy, just specify the .obj files in the command to DMD. > i'm just not exactly sure what format(s) it expects for the obj files. > that, and i've never heard of OMF. (or, more accurately, i've never seen > anything that supports it.) The object file format used by D and the linker is OMF (Object Module Format). It's a standard put out by Intel. |
March 21, 2003 Re: systems programming | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | On Thu, 20 Mar 2003 15:27:50 -0800, Walter <walter@digitalmars.com> wrote: > The LD "bin" format, if for windows32, is likely a PE (portable executable) > file. > not so. it's a raw binary without headers. like a 32-bit com file (if such a thing exists) without the extra 100-byte header. >> >> or linking to oject files compiled with a separate assembler. >> > Easy, just specify the .obj files in the command to DMD. >> i'm just not exactly sure what format(s) it expects for the obj files. >> that, and i've never heard of OMF. (or, more accurately, i've never seen >> anything that supports it.) > > The object file format used by D and the linker is OMF (Object Module > Format). It's a standard put out by Intel. > and the only other two linkers that seem to support it are Intel's and Borland's. i don't have access to Intel's. i never ceases to amaze me when some standards are never used by everyone. since i work on multiple platforms, i need the ability to work with more common object file formats (like elf and coff) and to output a raw 32-bit binary file (with no header, relocation, or segment data) for my project. i guess i'll have to wait for the GCC frontend before i can use D. suck. -- Charles "grey wolf" Banas |
March 21, 2003 Re: systems programming | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Banas | Charles Banas wrote: > On Thu, 20 Mar 2003 15:27:50 -0800, Walter <walter@digitalmars.com> wrote: [...] >> The object file format used by D and the linker is OMF (Object Module >> Format). It's a standard put out by Intel. >> > and the only other two linkers that seem to support it are Intel's and Borland's. i don't have access to Intel's. i never ceases to amaze me when some standards are never used by everyone. Also Microsoft's should support that, at least for backward compatibility, since MASM can output also OMF object files. So we have at least 3 multinational companies that uses this standard. > since i work on multiple platforms, i need the ability to work with more common object file formats (like elf and coff) and to output a raw 32-bit binary file (with no header, relocation, or segment data) for my project. i guess i'll have to wait for the GCC frontend before i can use D. suck. I think you'll need a _backend_ not a _frontend_. Have you tried the linux D compiler? Or you can write your own backend, since the frontend sources are public. Ciao |
March 21, 2003 Re: systems programming | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Banas | "Charles Banas" <greywolf@greyfade.net> wrote in message news:oprmdipc0b8ctebf@news.digitalmars.com... > On Thu, 20 Mar 2003 15:27:50 -0800, Walter <walter@digitalmars.com> wrote: and the only other two linkers that seem to support it are Intel's and Borland's. i don't have access to Intel's. i never ceases to amaze me when some standards are never used by everyone. It's because Microsoft wants to own all the standards. Sean |
March 21, 2003 Re: systems programming | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles Banas | "Charles Banas" <greywolf@greyfade.net> wrote in message news:oprmdipc0b8ctebf@news.digitalmars.com... > > The object file format used by D and the linker is OMF (Object Module Format). It's a standard put out by Intel. > and the only other two linkers that seem to support it are Intel's and Borland's. i don't have access to Intel's. i never ceases to amaze me when some standards are never used by everyone. OMF was the only one used on the PC by probably 50 compilers for about 12 years. It's a pretty well worn standard. The only compilers I know of that supports Microsoft's version of COFF is Microsoft's compilers. > since i work on multiple platforms, i need the ability to work with more common object file formats (like elf and coff) and to output a raw 32-bit binary file (with no header, relocation, or segment data) for my project. i guess i'll have to wait for the GCC frontend before i can use D. suck. The PE format is pretty simple, and it shouldn't be too hard to write an EXE2BIN for it, assuming that you've programmed out any references to DLLs, etc. |
March 22, 2003 Re: systems programming | ||||
---|---|---|---|---|
| ||||
Posted in reply to Roberto Mariottini | On Fri, 21 Mar 2003 09:13:10 +0100, Roberto Mariottini <rmariottini@lycosmail.com> wrote: >> since i work on multiple platforms, i need the ability to work with more common object file formats (like elf and coff) and to output a raw 32- bit binary file (with no header, relocation, or segment data) for my project. i guess i'll have to wait for the GCC frontend before i can use D. suck. > > I think you'll need a _backend_ not a _frontend_. > Have you tried the linux D compiler? > Or you can write your own backend, since the frontend sources are public. > i don't have the experience or skill to write a compiler backend myself. the linux D compiler, as it is, is still too early in the alpha stages to be of any use to me. i'd rather use something more mature like GCC or the existing win32 D compiler than this. even if only for experimentation. -- Charles "grey wolf" Banas |
March 22, 2003 Re: systems programming | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean L. Palmer | On Fri, 21 Mar 2003 10:44:05 -0800, Sean L. Palmer <seanpalmer@directvinternet.com> wrote: > "Charles Banas" <greywolf@greyfade.net> wrote in message > news:oprmdipc0b8ctebf@news.digitalmars.com... >> On Thu, 20 Mar 2003 15:27:50 -0800, Walter <walter@digitalmars.com> wrote: >> and the only other two linkers that seem to support it are Intel's and >> Borland's. i don't have access to Intel's. i never ceases to amaze me >> when some standards are never used by everyone. > > It's because Microsoft wants to own all the standards. > which is something i'd like to prevent. :) -- Charles "grey wolf" Banas |
Copyright © 1999-2021 by the D Language Foundation