Subject: patch for libdl/dlReloc.c (ultrix only)

From: [email-masked] (Paul M. Aoki)
Date: Wed, 14 Sep 94 16:23:01 -0700

if you have a mips/ultrix box with the R4400 processor upgrade, e.g.,
the 5000/50, 5000/150, 5000/260, 5000/280 or the upgraded 5900 server,
you must apply the following patch to src/tools/libdl/dlReloc.c in
order to make the dynamic loader work.

if you have some doubt as to your current processor type, you can do
something like
	% /etc/uerf -R -r 300 | grep 'CPU TYPE' | head -1
to find out.  (or bug your sysadmin.  do whatever comes naturally.)

the patch doesn't seem to be necessary for R2000/R3000 boxes.

*** 1.3	1994/03/01 05:42:11
--- dlReloc.c	1994/09/14 20:44:11
***************
*** 19,24 ****
--- 19,25 ----
   */
  #include <stdio.h>
  #include <sys/mman.h>
+ #include <mips/cachectl.h>
  #include "dl.h"
  #include "dlPriv.h"
  
***************
*** 314,325 ****
--- 315,335 ----
  		      PROT_EXEC) == -1) {
  	    fprintf(stderr, "dl: fail to protect text of %s\n", dlfile->filename);
  	}
+ 	/* flush the caches */
+ 	if (cacheflush((char *)dlfile->textAddress, dlfile->textSize,
+ 		       BCACHE) != 0) {
+ 	    fprintf(stderr, "dl: fail to flush text of %s\n", dlfile->filename);
+ 	}
  	/* protect jump tables, if any */
  	while(jmptable) {
  	    if (mprotect((char *)jmptable->block, pagesize, 
  			 PROT_EXEC) == -1) {
  		fprintf(stderr, "dl: fail to protect a jump table of %s\n", 
  			dlfile->filename);
+ 	    }
+ 	    /* flush the caches */
+ 	    if (cacheflush((char *)jmptable->block, pagesize, BCACHE) != 0) {
+ 		fprintf(stderr, "dl: fail to flush a jump table of %s\n", dlfile->filename);
  	    }
  	    jmptable= jmptable->next;
  	}

--
  Paul M. Aoki          |  University of California at Berkeley
  [email-masked]  |  Dept. of EECS, Computer Science Division (#1776)
                        |  Berkeley, CA 94720-1776

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]"

   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================