smith@compound.se (Bj|rn Smith) (02/18/91)
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