Aliasing text and data segments of a process

Doug Gwyn gwyn at brl-smoke.ARPA
Mon Jan 25 10:00:29 AEST 1988


In article <453 at minya.UUCP> jc at minya.UUCP (John Chambers) writes:
>Sure enough, there is supposedly separate address spaces for both...

You have to ask the linker for this feature, assuming your hardware
and OS support it; it's not the default.

>| 	code = (char*)malloc(1000);

code -> D-space.

>| 	fct = (int(*)())code;	/* Point to the malloc()ed data area */
>| 	i = (*fct)(7,9);	/* Call the copy */

If this works, you do not have split I&D space.



More information about the Comp.unix.wizards mailing list