From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <211e0549b6190c6b06826b118ff1fc88@terzarima.net> From: Charles Forsyth Date: Fri, 26 Nov 2004 12:37:41 +0000 To: 9fans@cse.psu.edu Subject: Re: [9fans] linker bug In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-byofeduteweanpxjbomzqggxfo" Topicbox-Message-UUID: 0cfb7722-eace-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-byofeduteweanpxjbomzqggxfo Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit the -R option means: the thing that reads in this program will put the data at an offset that is consistent with the value given by -R, so round the start of data accordingly. if it's right in the symbol table, and in the instructions, kl is correct. the problem will be with the program (bootstrap?) that reads in the program and sets it up in memory. --upas-byofeduteweanpxjbomzqggxfo Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by lavoro; Thu Nov 25 18:52:06 GMT 2004 Received: from psuvax1.cse.psu.edu (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id D5492C676F for ; Thu, 25 Nov 2004 13:46:32 -0500 (EST) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: from localhost (localhost [127.0.0.1]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 55CD963A0D for <9fans@cse.psu.edu>; Thu, 25 Nov 2004 13:46:15 -0500 (EST) Received: from mail.cse.psu.edu ([127.0.0.1]) by localhost (psuvax1 [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 10969-01 for <9fans@cse.psu.edu>; Thu, 25 Nov 2004 13:46:13 -0500 (EST) Received: from babingka.lava.net (babingka.lava.net [64.65.64.26]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 7EBB863A07 for <9fans@cse.psu.edu>; Thu, 25 Nov 2004 13:46:13 -0500 (EST) Received: from malasada.lava.net (malasada.lava.net [64.65.64.17]) by babingka.lava.net (Postfix) with ESMTP id 18F76133A7 for <9fans@cse.psu.edu>; Thu, 25 Nov 2004 08:46:12 -1000 (HST) Date: Thu, 25 Nov 2004 08:46:12 -1000 (HST) From: Tim Newsham To: 9fans@cse.psu.edu Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at cse.psu.edu Subject: [9fans] linker bug X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu Errors-To: 9fans-bounces+forsyth=terzarima.net@cse.psu.edu There appears to be a bug in the linker (at least in kl) when using the -R flag. When I specify a value of -R0x4 everything seems to work fine. If I specify larger values such as -R0x10, then occasionally (depending on the size of the text region, I presume) the emitted binary is incorrect. For example, if I have an initialized variable: static int x = 0x12345678; then the address of x (in the symbol table and as referenced by the instructions) will not line up with the initialized word that contains the value 0x12345678. I've stopped using the flag in this way (turns out I didnt need it after all), so I haven't tracked down the bug any further, but thought I'd mention it before it bites someone else. Tim N. --upas-byofeduteweanpxjbomzqggxfo--