David Eichmann pushed to branch wip/davide/windows-dlls_sysm-test_master at Glasgow Haskell Compiler / GHC

Commits:

4 changed files:

Changes:

  • rts/RtsSymbols.c
    ... ... @@ -1220,13 +1220,13 @@ RTS_SYMBOLS_PRIM
    1220 1220
     /* See Note [Naming Scheme for Symbol Macros] */
    
    1221 1221
     
    
    1222 1222
     #define SymI_HasProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
    
    1223
    -                    (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_CODE },
    
    1223
    +                    (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_CODE, NULL },
    
    1224 1224
     #define SymI_HasDataProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
    
    1225
    -                    (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_DATA },
    
    1225
    +                    (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_DATA, NULL },
    
    1226 1226
     #define SymE_HasProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
    
    1227
    -            (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_CODE },
    
    1227
    +            (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_CODE, NULL },
    
    1228 1228
     #define SymE_HasDataProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
    
    1229
    -            (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_DATA },
    
    1229
    +            (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_DATA, NULL },
    
    1230 1230
     
    
    1231 1231
     #define SymI_NeedsProto(vvv) SymI_HasProto(vvv)
    
    1232 1232
     #define SymI_NeedsDataProto(vvv) SymI_HasDataProto(vvv)
    
    ... ... @@ -1237,7 +1237,7 @@ RTS_SYMBOLS_PRIM
    1237 1237
     // another symbol.  See newCAF/newRetainedCAF/newGCdCAF for an example.
    
    1238 1238
     #define SymI_HasProto_redirect(vvv,xxx,strength,ty) \
    
    1239 1239
         { MAYBE_LEADING_UNDERSCORE_STR(#vvv),    \
    
    1240
    -      (void*)(&(xxx)), strength, ty },
    
    1240
    +      (void*)(&(xxx)), strength, ty, MAYBE_LEADING_UNDERSCORE_STR(#xxx) },
    
    1241 1241
     
    
    1242 1242
     static RtsSymbolVal * rtsSyms = NULL;
    
    1243 1243
     
    
    ... ... @@ -1264,7 +1264,7 @@ RtsSymbolVal const * getRtsSymbols(void) {
    1264 1264
                       RTS_ARM_OUTLINE_ATOMIC_SYMBOLS
    
    1265 1265
                       RTS_SYMBOLS_PRIM
    
    1266 1266
                       SymI_HasDataProto(nonmoving_write_barrier_enabled)
    
    1267
    -                  { 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE } /* sentinel */
    
    1267
    +                  { 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE, NULL } /* sentinel */
    
    1268 1268
                 };
    
    1269 1269
     
    
    1270 1270
                 uint32_t n = 1;
    
    ... ... @@ -1362,7 +1362,7 @@ RtsSymbolVal const * getRtsSymbols(void) {
    1362 1362
     //          CODE_SYM(getauxval)
    
    1363 1363
     //          CODE_SYM(posix_spawn_file_actions_init)
    
    1364 1364
     //          ...
    
    1365
    -//          { 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE } /* sentinel */
    
    1365
    +//          { 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE, NULL } /* sentinel */
    
    1366 1366
     //      };
    
    1367 1367
     //
    
    1368 1368
     //      RtsSymbolVal* rtsExtraSyms() {
    
    ... ... @@ -1375,7 +1375,7 @@ RtsSymbolVal const * getRtsSymbols(void) {
    1375 1375
     //
    
    1376 1376
     
    
    1377 1377
     static RtsSymbolVal default_extra_syms[] = {
    
    1378
    -      { 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE } /* sentinel */
    
    1378
    +      { 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE, NULL } /* sentinel */
    
    1379 1379
     };
    
    1380 1380
     
    
    1381 1381
     /* Default empty extra RTS symbols. See Note[Extra RTS symbols] */
    

  • rts/include/rts/RtsSymbols.h
    ... ... @@ -8,6 +8,7 @@
    8 8
     
    
    9 9
     #pragma once
    
    10 10
     
    
    11
    +#include <stdbool.h>
    
    11 12
     typedef void SymbolAddr;
    
    12 13
     typedef char SymbolName;
    
    13 14
     
    
    ... ... @@ -36,6 +37,9 @@ typedef struct _RtsSymbolVal {
    36 37
         SymbolAddr* addr;
    
    37 38
         SymStrength strength;
    
    38 39
         SymType type;
    
    40
    +    // If this is a redirection, then this is the lable of the
    
    41
    +    // target symbol. Otherwise NULL.
    
    42
    +    const SymbolName* lbl_redirect_target;
    
    39 43
     } RtsSymbolVal;
    
    40 44
     
    
    41 45
     RtsSymbolVal const * getRtsSymbols(void);

  • testsuite/tests/ghci/linking/T25155_iserv_main.c
    ... ... @@ -23,7 +23,7 @@ int main (int argc, char *argv[])
    23 23
     // can use the FFI call to foobar in a TH splice.
    
    24 24
     
    
    25 25
     #define SymI_HasProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
    
    26
    -                    (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_CODE },
    
    26
    +                    (void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_CODE, NULL },
    
    27 27
     
    
    28 28
     
    
    29 29
     void foobar(int x) {
    

  • testsuite/tests/rts/symbols/dumpDeclaredSymbols.c
    ... ... @@ -19,8 +19,16 @@ void dumpDeclaredSymbols(void) {
    19 19
                 type = "data";
    
    20 20
             }
    
    21 21
     
    
    22
    +        const char * lbl = NULL;
    
    23
    +        if (sym->lbl_redirect_target) {
    
    24
    +            // In the case of redirects, the true symbol name is lbl_redirect_target
    
    25
    +            lbl = sym->lbl_redirect_target;
    
    26
    +        } else {
    
    27
    +            lbl = sym->lbl;
    
    28
    +        }
    
    29
    +
    
    22 30
             if (type) {
    
    23
    -            printf("%s %s\n", sym->lbl, type);
    
    31
    +            printf("%s %s\n", lbl, type);
    
    24 32
             }
    
    25 33
         }
    
    26 34
     }