From 53c082117fdaee6390f4b187079576d42b5834d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 27 Nov 2004 12:34:11 +0000 Subject: [PATCH] Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10264 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/apps/rld/arch/x86/rldreloc.inc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/kernel/apps/rld/arch/x86/rldreloc.inc b/src/kernel/apps/rld/arch/x86/rldreloc.inc index dab6f10475..bdad24bd24 100644 --- a/src/kernel/apps/rld/arch/x86/rldreloc.inc +++ b/src/kernel/apps/rld/arch/x86/rldreloc.inc @@ -10,30 +10,32 @@ relocate_rel(image_t *image, struct Elf32_Rel *rel, int rel_len) { int i; struct Elf32_Sym *sym; - int vlErr; addr_t S; addr_t final_val; -# define P ((addr_t *)(image->regions[0].delta + rel[i].r_offset)) -# define A (*(P)) -# define B (image->regions[0].delta) +# define P ((addr_t *)(image->regions[0].delta + rel[i].r_offset)) +# define A (*(P)) +# define B (image->regions[0].delta) for (i = 0; i * (int)sizeof(struct Elf32_Rel) < rel_len; i++) { - unsigned type = ELF32_R_TYPE(rel[i].r_info); - switch (ELF32_R_TYPE(rel[i].r_info)) { + switch (type) { case R_386_32: case R_386_PC32: case R_386_GLOB_DAT: case R_386_JMP_SLOT: case R_386_GOTOFF: + { + status_t status; sym = SYMBOL(image, ELF32_R_SYM(rel[i].r_info)); - vlErr = resolve_symbol(image, sym, &S); - if(vlErr<0) { - return vlErr; + status = resolve_symbol(image, sym, &S); + if (status < B_OK) { + printf("resolve symbol returned: %ld\n", status); + return status; } + } } switch (type) { case R_386_NONE: @@ -91,6 +93,7 @@ relocate_rel(image_t *image, struct Elf32_Rel *rel, int rel_len) /* * rldelf.c requires this function to be implemented on a per-cpu basis */ + static bool relocate_image(image_t *image) {