|
@@ -326,7 +326,10 @@ static void dedotify_versions(struct modversion_info *vers,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/* Undefined symbols which refer to .funcname, hack to funcname (or .TOC.) */
|
|
|
+/*
|
|
|
+ * Undefined symbols which refer to .funcname, hack to funcname. Make .TOC.
|
|
|
+ * seem to be defined (value set later).
|
|
|
+ */
|
|
|
static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab)
|
|
|
{
|
|
|
unsigned int i;
|
|
@@ -334,8 +337,11 @@ static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab)
|
|
|
for (i = 1; i < numsyms; i++) {
|
|
|
if (syms[i].st_shndx == SHN_UNDEF) {
|
|
|
char *name = strtab + syms[i].st_name;
|
|
|
- if (name[0] == '.')
|
|
|
+ if (name[0] == '.') {
|
|
|
+ if (strcmp(name+1, "TOC.") == 0)
|
|
|
+ syms[i].st_shndx = SHN_ABS;
|
|
|
memmove(name, name+1, strlen(name));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -351,7 +357,7 @@ static Elf64_Sym *find_dot_toc(Elf64_Shdr *sechdrs,
|
|
|
numsyms = sechdrs[symindex].sh_size / sizeof(Elf64_Sym);
|
|
|
|
|
|
for (i = 1; i < numsyms; i++) {
|
|
|
- if (syms[i].st_shndx == SHN_UNDEF
|
|
|
+ if (syms[i].st_shndx == SHN_ABS
|
|
|
&& strcmp(strtab + syms[i].st_name, "TOC.") == 0)
|
|
|
return &syms[i];
|
|
|
}
|