git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libc - Fixed an embarrasing bug in strchr :|
[tpg/acess2.git]
/
Usermode
/
Libraries
/
ld-acess.so_src
/
loadlib.c
diff --git
a/Usermode/Libraries/ld-acess.so_src/loadlib.c
b/Usermode/Libraries/ld-acess.so_src/loadlib.c
index
e5090dd
..
a5f0bc2
100644
(file)
--- a/
Usermode/Libraries/ld-acess.so_src/loadlib.c
+++ b/
Usermode/Libraries/ld-acess.so_src/loadlib.c
@@
-16,13
+16,12
@@
Uint IsFileLoaded(char *file);
int GetSymbolFromBase(Uint base, char *name, Uint *ret);
Uint IsFileLoaded(char *file);
int GetSymbolFromBase(Uint base, char *name, Uint *ret);
-// ===
CONSTAN
TS ===
-const struct {
+// ===
IMPOR
TS ===
+
extern
const struct {
Uint Value;
char *Name;
Uint Value;
char *Name;
-} caLocalExports[] = {
- {(Uint)gLoadedLibraries, "gLoadedLibraries"}
-};
+} caLocalExports[];
+extern const int ciNumLocalExports;
// === GLOABLS ===
tLoadedLib gLoadedLibraries[MAX_LOADED_LIBRARIES];
// === GLOABLS ===
tLoadedLib gLoadedLibraries[MAX_LOADED_LIBRARIES];
@@
-200,7
+199,9
@@
Uint GetSymbol(char *name)
{
int i;
Uint ret;
{
int i;
Uint ret;
- for(i=0;i<sizeof(caLocalExports)/sizeof(caLocalExports[0]);i++)
+
+ //SysDebug("ciNumLocalExports = %i", ciNumLocalExports);
+ for(i=0;i<ciNumLocalExports;i++)
{
if( strcmp(caLocalExports[i].Name, name) == 0 )
return caLocalExports[i].Value;
{
if( strcmp(caLocalExports[i].Name, name) == 0 )
return caLocalExports[i].Value;
@@
-210,11
+211,11
@@
Uint GetSymbol(char *name)
{
if(gLoadedLibraries[i].Base == 0) break;
{
if(gLoadedLibraries[i].Base == 0) break;
- //SysDebug(" GetSymbol: Trying 0x%x, '%s'
\n
",
+ //SysDebug(" GetSymbol: Trying 0x%x, '%s'",
// gLoadedLibraries[i].Base, gLoadedLibraries[i].Name);
if(GetSymbolFromBase(gLoadedLibraries[i].Base, name, &ret)) return ret;
}
// gLoadedLibraries[i].Base, gLoadedLibraries[i].Name);
if(GetSymbolFromBase(gLoadedLibraries[i].Base, name, &ret)) return ret;
}
- SysDebug("GetSymbol: === Symbol '%s' not found ===
\n
", name);
+ SysDebug("GetSymbol: === Symbol '%s' not found ===", name);
return 0;
}
return 0;
}
@@
-228,6
+229,7
@@
int GetSymbolFromBase(Uint base, char *name, Uint *ret)
return ElfGetSymbol(base, name, ret);
if(*(Uint16*)base == ('M'|('Z'<<8)))
return PE_GetSymbol(base, name, ret);
return ElfGetSymbol(base, name, ret);
if(*(Uint16*)base == ('M'|('Z'<<8)))
return PE_GetSymbol(base, name, ret);
+ SysDebug("Unknown type at %p", base);
return 0;
}
return 0;
}
UCC
git Repository :: git.ucc.asn.au