🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: gnu.g++.lib.bug
1 messages
1 total messages Started by jonathan Mon, 18 Dec 1989 00:32
ligb++-1.36.1 bug in test0 on Pyramids.
#542
Author: jonathan
Date: Mon, 18 Dec 1989 00:32
47 lines
1490 bytes
Test0 fails to run on machines that do not allow the data segment to
be executed (for example, Pyramids running OSx 4.n).

The following diff fixes this problem on a Pyramid.

*** test.hello.cc.DIST	Thu Nov  9 00:28:31 1989
--- test.hello.cc	Mon Dec 18 13:18:39 1989
***************
*** 20,25 ****
--- 20,35 ----
  #endif
  
  
+ #ifdef __pyr__
+ #define MUST_MPROTECT
+ #include <sys/mman.h>
+ 
+ extern "C" {
+   int
+   mprotect (char *, int, int);
+ }
+ #endif
+ 
  class tfile
  {
  public:
***************
*** 101,106 ****
--- 111,128 ----
  
    read (fd, (char*) init_fn, size);
    close (fd);
+ 
+ #ifdef MUST_MPROTECT
+  {
+    void * rounded_size = (void *) ((size + pagsiz-1)&~(pagsiz-1));
+    int status = mprotect ((char*)init_fn, round_size,
+ 			  PROT_READ|PROT_EXEC|PROT_WRITE);
+    if (status !=0 ) {
+      perror ("making dynamically loaded code executable");
+      exit(errno);
+    }
+ }
+ #endif /* MUST_MPROTECT */
  
    fprintf (stderr, "load symbol-table at address 0x%x\n", init_fn);
  
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads