Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!samsung!uakari.primate.wisc.edu!dali.cs.montana.edu!rpi!uupsi!sunic!comsys!smith From: smith@compound.se (Bj|rn Smith) Newsgroups: comp.unix.xenix.sco Subject: Relocating data space Keywords: relocate link ld shared memory shmat Message-ID: <252@comsys.UUCP> Date: 18 Feb 91 08:33:08 GMT Reply-To: smith@compound.se (Bj|rn Smith) Organization: Compound Systems Lines: 42 UUCP-Path: sunic!comsys!smith Is there a way of linking a program in such a way that the data area (or a part of the data area) is relocated to an address outside the process address space ? This is the case: . . int shdata[1024]; . . main() { . /* Before accessing any data: Allocate a shared memory */ /* segment which normally returns an address 64000000 hex. */ . shdata[0] = 37; /* This will access the first int in the */ /* shared memory segment. */ . . Now I want to link the program so that references to "shdata" will end up on addresses 64000000 hex and above. I have tried cc prog.c -o prog -link -Rd 64000000 which did what I wanted but when trying to run the program it fails to execute and I get "prog: Killed" and a return code 137 (dec). Anyone have any ideas how do this ? (I know that shared memory should be accessed through the pointer returned by shmat() but thats not the point. The object file accessing "shdata" is produces in a language unable to reference addresses.) Thanks in advance for any kind of help ! -- Bj|rn Smith Compound Systems, phone +46 8 7923689 UUCP: {uunet,mcsun}!sunic!comsys!smith Internet: smith@compound.se