@@ -29,7 +29,7 @@ index c3a5b5d..b826af8 100644
29
29
+ default: barf("symbolTypeString: unknown symbol type (%d)", type);
30
30
}
31
31
}
32
-
32
+
33
33
@@ -277,10 +277,19 @@ int ghciInsertSymbolTable(
34
34
}
35
35
else if (pinfo->type ^ type)
@@ -58,7 +58,7 @@ index c3a5b5d..b826af8 100644
58
58
);
59
59
+ debugBelch("Address of new symbol: %p, old symbol: %p\n", data, pinfo->value);
60
60
+ debugBelch("Type of symbol; new: %d, existing: %d\n", type, pinfo->type);
61
-
61
+
62
62
return 0;
63
63
}
64
64
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h
@@ -72,8 +72,8 @@ index 6cadaa8..3beac1d 100644
72
72
+ SYM_TYPE_HIDDEN = 1 << 4, /* the symbol is hidden and should not be exported */
73
73
+
74
74
} SymType;
75
-
76
-
75
+
76
+
77
77
diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c
78
78
index 9f56812..05db9b3 100644
79
79
--- a/rts/linker/Elf.c
@@ -85,9 +85,9 @@ index 9f56812..05db9b3 100644
85
85
+ if(ELF_ST_VISIBILITY(symbol->elf_sym->st_other) == STV_HIDDEN) {
86
86
+ sym_type |= SYM_TYPE_HIDDEN;
87
87
+ }
88
-
88
+
89
89
/* And the decision is ... */
90
-
90
+
91
91
diff --git a/rts/linker/ElfTypes.h b/rts/linker/ElfTypes.h
92
92
index 24e29a1..d3524e1 100644
93
93
--- a/rts/linker/ElfTypes.h
@@ -116,7 +116,26 @@ diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
116
116
index 010dc8f..c6f82b7 100644
117
117
--- a/rts/linker/PEi386.c
118
118
+++ b/rts/linker/PEi386.c
119
- @@ -1942,7 +1942,7 @@ static size_t
119
+ @@ -1897,6 +1897,9 @@ ocGetNames_PEi386 ( ObjectCode* oc )
120
+ sname[size-start]='\0';
121
+ stgFree(tmp);
122
+ sname = strdup (sname);
123
+ + if(secNumber == IMAGE_SYM_UNDEFINED)
124
+ + type |= SYM_TYPE_HIDDEN;
125
+ +
126
+ if (!ghciInsertSymbolTable(oc->fileName, symhash, sname,
127
+ addr, false, type, oc))
128
+ return false;
129
+ @@ -1919,6 +1922,8 @@ ocGetNames_PEi386 ( ObjectCode* oc )
130
+ if (isWeak) {
131
+ setWeakSymbol(oc, sname);
132
+ }
133
+ + if(secNumber == IMAGE_SYM_UNDEFINED)
134
+ + type |= SYM_TYPE_HIDDEN;
135
+
136
+ if (! ghciInsertSymbolTable(oc->fileName, symhash, sname, addr,
137
+ isWeak, type, oc))
138
+ @@ -1946,7 +1946,7 @@ static size_t
120
139
makeSymbolExtra_PEi386( ObjectCode* oc, uint64_t index STG_UNUSED, size_t s, char* symbol STG_UNUSED, SymType type )
121
140
{
122
141
SymbolExtra *extra;
@@ -125,6 +144,6 @@ index 010dc8f..c6f82b7 100644
125
144
case SYM_TYPE_CODE: {
126
145
// jmp *-14(%rip)
127
146
extra = m32_alloc(oc->rx_m32, sizeof(SymbolExtra), 8);
128
- - -
147
+ - -
129
148
2.33.0
130
149
0 commit comments