Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!sdcsvax!ucsdhub!jack!man!nusdhub!rwhite From: rwhite@nusdhub.UUCP (Robert C. White Jr.) Newsgroups: comp.lang.c Subject: Re: Types Message-ID: <117@nusdhub.UUCP> Date: Fri, 9-Oct-87 13:33:39 EDT Article-I.D.: nusdhub.117 Posted: Fri Oct 9 13:33:39 1987 Date-Received: Sun, 11-Oct-87 17:38:13 EDT References: <7264@brl-adm.ARPA> <734@sdchema.sdchem.UUCP> <293@osupyr.UUCP> <384@mcdsun.UUCP> Organization: National University, San Diego Lines: 40 Summary: Linking Assembler. In article <384@mcdsun.UUCP>, fnf@mcdsun.UUCP (Fred Fish) writes: > the linker fix up all the jumps that are really "near" jumps > to be "near" jumps. In either case, you either grow or > shrink the code as appropriate, in the linker. What could > be easier? In either case, you end up with exactly the same > executable object code. No nops, no "non-optimal" jumps, the > *same* *optimal* *code*. First, a linker is a "linking loader" and it's only REAL purpose is to resolve refrences and setup dynamic relocation information. ALL "short" jumps [add/subtract value from the instruction pointer directly] are compleetly generated and closed in the assembler. If there were to be an alteration in the size of a block of code-text, the linker would have to "reassemble" the code block to make up for the altered "short" jumps and such. In order for the linker to do this it would either need the source code, or it would have to take a stab at disassembeling the object code and hope not to get it wrong. The assembler is designed to AUTOMATICALLY determine the "near"ness or "far"ness of a refrence. This works beautfuly as long as you act like a pascal programmer and only use backward refrences. For the forward refrences you must use a keyword like "near" or "far" or else take what you get, and hope what you get is close enough to work. It should be obvious that the assemblers job is to assemble and the linkers job is to link. MR FRED: At one point you said "what could be simpler" [deleted from this text for brevity]. If it is so simple, I would love to see your compleeted disassembling-assebeling-optomizing-editing-linking-loader on the market. [For a PC or 3B2 prefreable, as these are the machines I have avalible to test it on.] Discalmer: YES! I used x86 refrences, I did this because I like to stick to topics and machines I know, so _PLEASE_, no "there are other machines in existance, you introverted slob..." type flames. And, yes, I am woking on my spelling, but if I waited till my dislexic brain could do it perfectly, nobody would ever see my deathless prose. Rob ("So who asked you anyway?") white.