return l->path;
}
-static int elf64_find_section(const char *map, unsigned int type, unsigned int *offset, unsigned int *size, unsigned int *vaddr)
+static int elf64_find_section(const char *map, unsigned int type, unsigned long *offset, unsigned long *size, unsigned long *vaddr)
{
Elf64_Ehdr *e;
Elf64_Phdr *ph;
return -1;
}
-static int elf32_find_section(const char *map, unsigned int type, unsigned int *offset, unsigned int *size, unsigned int *vaddr)
+static int elf32_find_section(const char *map, unsigned int type, unsigned long *offset, unsigned long *size, unsigned long *vaddr)
{
Elf32_Ehdr *e;
Elf32_Phdr *ph;
return -1;
}
-static int elf_find_section(const char *map, unsigned int type, unsigned int *offset, unsigned int *size, unsigned int *vaddr)
+static int elf_find_section(const char *map, unsigned int type, unsigned long *offset, unsigned long *size, unsigned long *vaddr)
{
int clazz = map[EI_CLASS];
return -1;
}
-static int elf32_scan_dynamic(const char *map, int dyn_offset, int dyn_size, int load_offset)
+static int elf32_scan_dynamic(const char *map, unsigned long dyn_offset, unsigned long dyn_size, long load_offset)
{
Elf32_Dyn *dynamic = (Elf32_Dyn *) (map + dyn_offset);
const char *strtab = NULL;
return 0;
}
-static int elf64_scan_dynamic(const char *map, int dyn_offset, int dyn_size, int load_offset)
+static int elf64_scan_dynamic(const char *map, unsigned long dyn_offset, unsigned long dyn_size, long load_offset)
{
Elf64_Dyn *dynamic = (Elf64_Dyn *) (map + dyn_offset);
const char *strtab = NULL;
int elf_load_deps(const char *path, const char *map)
{
- unsigned int dyn_offset, dyn_size;
- unsigned int load_offset, load_vaddr;
- unsigned int interp_offset;
-#if defined(__mips__) && (__mips == 64)
- static int gcc_mips64_bug_work_around;
-
- gcc_mips64_bug_work_around = 1;
-#endif
- if (elf_find_section(map, PT_LOAD, &load_offset, NULL, &load_vaddr)) {
- ERROR("failed to load the .load section from %s\n", path);
- return -1;
- }
-
- if (elf_find_section(map, PT_DYNAMIC, &dyn_offset, &dyn_size, NULL)) {
- ERROR("failed to load the .dynamic section from %s\n", path);
- return -1;
- }
+ unsigned long dyn_offset, dyn_size;
+ unsigned long load_offset, load_vaddr;
+ unsigned long interp_offset;
if (elf_find_section(map, PT_INTERP, &interp_offset, NULL, NULL) == 0) {
add_path_and_deps(map+interp_offset, 1, -1, 0);
}
- int clazz = map[EI_CLASS];
+ if (elf_find_section(map, PT_LOAD, &load_offset, NULL, &load_vaddr)) {
+ DEBUG("failed to load the .load section from %s\n", path);
+ return 0;
+ }
-#if defined(__mips__) && (__mips == 64)
- if (gcc_mips64_bug_work_around != 1) {
- ERROR("compiler bug: GCC for MIPS64 should be fixed!\n");
- return -1;
+ if (elf_find_section(map, PT_DYNAMIC, &dyn_offset, &dyn_size, NULL)) {
+ DEBUG("failed to load the .dynamic section from %s\n", path);
+ return 0;
}
- gcc_mips64_bug_work_around = 0;
-#endif
+
+ int clazz = map[EI_CLASS];
if (clazz == ELFCLASS32)
return elf32_scan_dynamic(map, dyn_offset, dyn_size, load_vaddr - load_offset);