digitalmars.D - The Linker is not a Magical Program
- Walter Bright (2/2) Sep 03 2009 A rant I wrote a few months ago:
- Brad Roberts (5/8) Sep 03 2009 From the outside, no. From the inside.. I dunno that I can agree. The
- sclytrack (9/9) Sep 03 2009 That is probably because most books don't explain it properly. Heck my C...
- Sclytrack (16/16) Sep 03 2009 I was wondering if the following is useful, probably not.
- davidl (6/22) Sep 03 2009 I think the above is designed for .di files. However, maybe we should
- Jeremie Pelletier (6/9) Sep 03 2009 Great read, reminded me of my first weeks in C/C++ land, back when I cou...
- Walter Bright (2/4) Sep 03 2009 http://www.azillionmonkeys.com/qed/Omfg.pdf
- grauzone (4/10) Sep 03 2009 What I always wanted to know: besides OPTLINK, is there an OMF linker
- Walter Bright (2/14) Sep 03 2009 Maybe the watcom one. But I've never tried it.
- grauzone (3/18) Sep 03 2009 I know someone who tried sufficiently hard, but failed. But I don't
- Walter Bright (3/22) Sep 03 2009 What originally motivated me to get our own linker was the erratic
- Jeremie Pelletier (2/8) Sep 03 2009 Sweet, you're the man Walter!
- Christopher Wright (2/5) Sep 03 2009 For reference, GNU ld has to be compiled with -linvisible-pink-unicorn.
- Jeremie Pelletier (2/8) Sep 03 2009 How can you know its pink if its also invisible?
- Jarrett Billingsley (2/10) Sep 03 2009 Colorless green dreams sleep furiously.
- Daniel Keep (21/30) Sep 03 2009 http://en.wikipedia.org/wiki/Invisible_pink_unicorn
A rant I wrote a few months ago: http://programmer.97things.oreilly.com/wiki/index.php/The_Linker_Is_not_a_Magical_Program
Sep 03 2009
On Thu, 3 Sep 2009, Walter Bright wrote:A rant I wrote a few months ago: http://programmer.97things.oreilly.com/wiki/index.php/The_Linker_Is_not_a_Magical_ProgramFrom the outside, no. From the inside.. I dunno that I can agree. The ability to navigate the maze of half-documented, often wrongly-implemented, etc... object file formats and still result in a working binary approaches being magic.
Sep 03 2009
That is probably because most books don't explain it properly. Heck my C++ book doesn't even mention it. And for the extern keyword there is only one very short explanation. extern: Storage class for objects declared outside the local block. Oh and I read your rant about linkers, ... and it still looks magical. And I bet Andrei's book will keep it short too. And Magic isn't always a bad thing. And the D shared libraries thing, very complex, no magic.
Sep 03 2009
I was wondering if the following is useful, probably not. Reserve a spot on the vtable, which is automatically set to NULL. class AClass { __virtualspot void caption(string text); //no implementation __virtualspot string caption(); } class BClass:AClass { } BClass b = new BClass(); b.caption = "test"; //compiles 1. Would compile. But it would not run if the vtable spot has not been filled up by some API. 2. Can derive from the class/interface, without providing the implementation.
Sep 03 2009
ÔÚ Fri, 04 Sep 2009 04:39:28 +0800£¬Sclytrack <idiot hotmail.com> дµÀ:I was wondering if the following is useful, probably not. Reserve a spot on the vtable, which is automatically set to NULL. class AClass { __virtualspot void caption(string text); //no implementation __virtualspot string caption(); }I think the above is designed for .di files. However, maybe we should limit it to di only. If it's in .d, it probably a bug or workaround of dmd bugs.class BClass:AClass { } BClass b = new BClass(); b.caption = "test"; //compiles 1. Would compile. But it would not run if the vtable spot has not been filled up by some API. 2. Can derive from the class/interface, without providing the implementation.-- ʹÓà Opera ¸ïÃüÐԵĵç×ÓÓʼþ¿Í»§³ÌÐò: http://www.opera.com/mail/
Sep 03 2009
Walter Bright Wrote:A rant I wrote a few months ago: http://programmer.97things.oreilly.com/wiki/index.php/The_Linker_Is_not_a_Magical_ProgramGreat read, reminded me of my first weeks in C/C++ land, back when I couldn't tell the compiler from the linker :) These days only the OMF format on Windows still seems magic because I can't find any decent documentation on its format. I had the hardest of times putting together a CodeView reader, finally got one working after consulting at least 10 different documents, looking at shitloads of codeview data in hex editors, and plenty of trial and error magic, and I still only support version 4.10, but I guess that makes me a magician! Now if I only can find enough documentation about OMF to write a COFF to OMF converter.. there are still a bunch of libraries I use in C which I'd like to compile to static libraries in VC++ and link in DMD. I tried compiling with DMC to generate static OMF libraries directly, but they always fail on missing files like <xmmintrin.h> and other misc issues. I also searched the web high and low for a coff2omf binary and only found one which generate broken libraries, dmd won't see any symbols in the converted files and the linker goes crazy on unresolved references. I tried link /CONVERT only to find out there is no /CONVERT option. So yeah, the linker is not a magical program, but it does operate in a magical world.
Sep 03 2009
Jeremie Pelletier wrote:Now if I only can find enough documentation about OMF to write a COFF to OMF converter..http://www.azillionmonkeys.com/qed/Omfg.pdf
Sep 03 2009
Walter Bright wrote:Jeremie Pelletier wrote:What I always wanted to know: besides OPTLINK, is there an OMF linker that can link D programs? I couldn't find one.Now if I only can find enough documentation about OMF to write a COFF to OMF converter..http://www.azillionmonkeys.com/qed/Omfg.pdf
Sep 03 2009
grauzone wrote:Walter Bright wrote:Maybe the watcom one. But I've never tried it.Jeremie Pelletier wrote:What I always wanted to know: besides OPTLINK, is there an OMF linker that can link D programs? I couldn't find one.Now if I only can find enough documentation about OMF to write a COFF to OMF converter..http://www.azillionmonkeys.com/qed/Omfg.pdf
Sep 03 2009
Walter Bright wrote:grauzone wrote:I know someone who tried sufficiently hard, but failed. But I don't remember what exactly was the problem.Walter Bright wrote:Maybe the watcom one. But I've never tried it.Jeremie Pelletier wrote:What I always wanted to know: besides OPTLINK, is there an OMF linker that can link D programs? I couldn't find one.Now if I only can find enough documentation about OMF to write a COFF to OMF converter..http://www.azillionmonkeys.com/qed/Omfg.pdf
Sep 03 2009
grauzone wrote:Walter Bright wrote:What originally motivated me to get our own linker was the erratic reliability of other ones.grauzone wrote:I know someone who tried sufficiently hard, but failed. But I don't remember what exactly was the problem.Walter Bright wrote:Maybe the watcom one. But I've never tried it.Jeremie Pelletier wrote:What I always wanted to know: besides OPTLINK, is there an OMF linker that can link D programs? I couldn't find one.Now if I only can find enough documentation about OMF to write a COFF to OMF converter..http://www.azillionmonkeys.com/qed/Omfg.pdf
Sep 03 2009
Walter Bright Wrote:Jeremie Pelletier wrote:Sweet, you're the man Walter!Now if I only can find enough documentation about OMF to write a COFF to OMF converter..http://www.azillionmonkeys.com/qed/Omfg.pdf
Sep 03 2009
Walter Bright wrote:A rant I wrote a few months ago: http://programmer.97things.oreilly.com/wiki/index.php/The_Linker_Is_n t_a_Magical_ProgramFor reference, GNU ld has to be compiled with -linvisible-pink-unicorn.
Sep 03 2009
Christopher Wright Wrote:Walter Bright wrote:How can you know its pink if its also invisible?A rant I wrote a few months ago: http://programmer.97things.oreilly.com/wiki/index.php/The_Linker_Is_n t_a_Magical_ProgramFor reference, GNU ld has to be compiled with -linvisible-pink-unicorn.
Sep 03 2009
On Fri, Sep 4, 2009 at 12:15 AM, Jeremie Pelletier<jeremiep gmail.com> wrote:Christopher Wright Wrote:Colorless green dreams sleep furiously.Walter Bright wrote:How can you know its pink if its also invisible?A rant I wrote a few months ago: http://programmer.97things.oreilly.com/wiki/index.php/The_Linker_Is_not_a_Magical_ProgramFor reference, GNU ld has to be compiled with -linvisible-pink-unicorn.
Sep 03 2009
Jeremie Pelletier wrote:Christopher Wright Wrote:http://en.wikipedia.org/wiki/Invisible_pink_unicorn Quoteth: The Invisible Pink Unicorn (IPU) is the goddess of a parody religion used to satirize theistic beliefs, taking the form of a unicorn that is paradoxically both invisible and pink. This makes her a rhetorical illustration used by atheists and other religious skeptics. The IPU is used to argue that supernatural beliefs are arbitrary by, for example, replacing the word God in any theistic statement with Invisible Pink Unicorn. The mutually exclusive attributes of pinkness and invisibility, coupled with the inability to disprove the IPU's existence, is intended to satirize what IPU proponents claim are contradictions in properties that some theists attribute to a theistic deity. ... "Invisible Pink Unicorns are beings of great spiritual power. We know this because they are capable of being invisible and pink at the same time. Like all religions, the Faith of the Invisible Pink Unicorns is based upon both logic and faith. We have faith that they are pink; we logically know that they are invisible because we can't see them." — Steve EleyWalter Bright wrote:How can you know its pink if its also invisible?A rant I wrote a few months ago: http://programmer.97things.oreilly.com/wiki/index.php/The_Linker_Is_n t_a_Magical_ProgramFor reference, GNU ld has to be compiled with -linvisible-pink-unicorn.
Sep 03 2009