Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

function pointers in EH tables are relocated to PLT entries #821

Merged
merged 1 commit into from almost 2 years ago

2 participants

Martin Nowak Walter Bright
Martin Nowak
Collaborator
  • replace global symbol relocations with offsets
  • remove redundant function pointer in DHandlerTable
  • saves runtime relocations

requires: D-Programming-Language/druntime#185

Martin Nowak function pointers in EH tables are relocated to PLT entries
- replace global symbol relocations with offsets
- remove redundant function pointer in DHandlerTable
- saves runtime relocations
aced1c8
Martin Nowak MartinNowak referenced this pull request in D-Programming-Language/druntime March 21, 2012
Merged

fix EH relocations #185

Martin Nowak
Collaborator

@braddr What can we do about teaching the auto tester dependent pulls?

Walter Bright WalterBright merged commit cae2114 into from July 23, 2012
Walter Bright WalterBright closed this July 23, 2012
Brad Roberts braddr referenced this pull request from a commit October 21, 2012
Commit has since been removed from the repository and is no longer available.
Deleted user Unknown referenced this pull request from a commit December 24, 2013
Commit has since been removed from the repository and is no longer available.
Deleted user Unknown referenced this pull request from a commit December 25, 2013
Commit has since been removed from the repository and is no longer available.
Deleted user Unknown referenced this pull request from a commit December 25, 2013
Commit has since been removed from the repository and is no longer available.
Deleted user Unknown referenced this pull request from a commit December 25, 2013
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 21, 2012
Martin Nowak function pointers in EH tables are relocated to PLT entries
- replace global symbol relocations with offsets
- remove redundant function pointer in DHandlerTable
- saves runtime relocations
aced1c8
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 11 additions and 4 deletions. Show diff stats Hide diff stats

  1. 15  src/eh.c
15  src/eh.c
@@ -89,7 +89,7 @@ void except_fillInEHTable(symbol *s)
89 89
     dt_t **pdt = &s->Sdt;
90 90
 
91 91
     /*
92  
-        void*           pointer to start of function
  92
+        void*           pointer to start of function (Windows)
93 93
         unsigned        offset of ESP from EBP
94 94
         unsigned        offset from start of function to return code
95 95
         unsigned nguards;       // dimension of guard[] (Linux)
@@ -116,9 +116,12 @@ void except_fillInEHTable(symbol *s)
116 116
     int sz = 0;
117 117
 
118 118
     // Address of start of function
  119
+#if OUREH
  120
+#else
119 121
     symbol_debug(funcsym_p);
120 122
     pdt = dtxoff(pdt,funcsym_p,0,TYnptr);
121 123
     sz += fsize;
  124
+#endif
122 125
 
123 126
     //printf("ehtables: func = %s, offset = x%x, startblock->Boffset = x%x\n", funcsym_p->Sident, funcsym_p->Soffset, startblock->Boffset);
124 127
 
@@ -196,6 +199,7 @@ void except_fillInEHTable(symbol *s)
196 199
 
197 200
             if (b->jcatchvar)                           // if try-catch
198 201
             {
  202
+                assert(catchoffset);
199 203
                 pdt = dtdword(pdt,catchoffset);
200 204
                 pdt = dtsize_t(pdt,0);                  // no finally handler
201 205
 
@@ -210,7 +214,8 @@ void except_fillInEHTable(symbol *s)
210 214
                 // To successor of BC_finally block
211 215
                 bhandler = list_block(bhandler->Bsucc);
212 216
 #if OUREH
213  
-                pdt = dtxoff(pdt,funcsym_p,bhandler->Boffset - startblock->Boffset, TYnptr);    // finally handler address
  217
+                assert(bhandler->Boffset > startblock->Boffset);
  218
+                pdt = dtsize_t(pdt,bhandler->Boffset - startblock->Boffset);    // finally handler offset
214 219
 #else
215 220
                 pdt = dtcoff(pdt,bhandler->Boffset);  // finally handler address
216 221
 #endif
@@ -293,7 +298,8 @@ void except_fillInEHTable(symbol *s)
293 298
                 pdt = dtdword(pdt,stack[stacki - 1]);   // parent index
294 299
                 pdt = dtdword(pdt,0);           // no catch offset
295 300
 #if OUREH
296  
-                pdt = dtxoff(pdt,funcsym_p,foffset - startblock->Boffset, TYnptr);    // finally handler offset
  301
+                assert(foffset > startblock->Boffset);
  302
+                pdt = dtsize_t(pdt,foffset - startblock->Boffset);    // finally handler offset
297 303
 #else
298 304
                 pdt = dtcoff(pdt,foffset);  // finally handler address
299 305
 #endif
@@ -337,7 +343,8 @@ void except_fillInEHTable(symbol *s)
337 343
                 pdt = dtsize_t(pdt,cod3_bpoffset(b->jcatchvar));     // EBP offset
338 344
 
339 345
 #if OUREH
340  
-                pdt = dtxoff(pdt,funcsym_p,bcatch->Boffset - startblock->Boffset, TYnptr);  // catch handler address
  346
+                assert(bcatch->Boffset > startblock->Boffset);
  347
+                pdt = dtsize_t(pdt,bcatch->Boffset - startblock->Boffset);  // catch handler offset
341 348
 #else
342 349
                 pdt = dtcoff(pdt,bcatch->Boffset);        // catch handler address
343 350
 #endif
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.