Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!vuwcomp!andrew From: andrew@comp.vuw.ac.nz (Andrew Vignaux) Newsgroups: comp.sys.hp Subject: 9000/835 loader and assembler problems Message-ID: <14870@comp.vuw.ac.nz> Date: 1 Jun 89 04:20:46 GMT Reply-To: andrew@comp.vuw.ac.nz (Andrew Vignaux) Organization: Comp Sci, Victoria University, Wellington, New Zealand. Lines: 62 X-Running: HP9000/835, HPUX 3.01 I've hit a small problem trying to port KCl to our 835. KCl uses dynamic loading [ld -A] to load its object files into memory. However, it has appended some text to the object file which it loads separately. All the lds that I have seen before, allow extra rubbish on the end of object files, but the 835 loader says /bin/ld: foo.o: Not a valid object file (invalid system id) if the length of the data is >= 128 bytes. Interestingly, it works fine if the length is < 128 bytes. [The system-id is valid in both cases!] Any ideas? Another problem I am having, is what to do with the object file after I have loaded it. I read the object module's header to determine how much space I should allocate in memory. I allocate the space, and pass the starting address to "ld -A bar -R %x -o baz". The object file that I get back has a number of interesting properties - the starting address of the text segment has been rounded up to a page boundary -- is there anything in the architecture that requires this? - the starting address of the data segment has also been rounded up to a page boundary. Again is there any real reason for this? - I want to branch to the first routine in the file. The inter-space stub seems to be at TEXT+4 (*TEXT is a break). Is there a better way to find this? - the header gives a different size than the one I worked out earlier [Surprise, surprise]. Any suggestions on a better size predictor (I am currently using size+PAGESIZE). I guess I should write my own linker :-( While I've got your attention :-), are there any 9000/800 assembler gurus out there? I've got the following declaration C declaration: extern struct character character_table[]; which KCl indexes with a character. Because characters are signed on some machines, the space for the array is defined in an assembler file .globl _character_table .space 1024 _character_table: .space 1024 in the appropriate syntax for the particular machine. Note: the label is in the middle of the space. I've been able to put this in the DATA subspace but not in the BSS subspace. Any thoughts on how to get this in the BSS subspace? Is it possible to get the assembler to define a symbol that is the value of another symbol + an offset? Andrew -- Domain address: andrew@comp.vuw.ac.nz Path address: ...!uunet!vuwcomp!andrew