[Skiboot] [PATCH 01/11] Make relocate() return specific error as to what went wrong
Stewart Smith
stewart at linux.vnet.ibm.com
Thu May 7 17:11:40 AEST 2015
Useful in debugging odd problems, such as skiboot > 1MB.
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
asm/head.S | 2 +-
core/relocate.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/asm/head.S b/asm/head.S
index 955c3b5..6b72ef8 100644
--- a/asm/head.S
+++ b/asm/head.S
@@ -438,7 +438,7 @@ call_relocate:
mr %r3,%r30
bl relocate
cmpwi %r3,0
- beq 1f
+ bne 1f
mtlr %r14
blr
1: /* Fatal relocate failure */
diff --git a/core/relocate.c b/core/relocate.c
index f6bda37..7255803 100644
--- a/core/relocate.c
+++ b/core/relocate.c
@@ -45,21 +45,21 @@ int relocate(uint64_t offset, struct elf64_dyn *dyn, struct elf64_rela *rela)
/* If we miss either rela or relacount, bail */
if (!dt_rela || !dt_relacount)
- return false;
+ return -1;
/* Check if the offset is consistent */
if ((offset + dt_rela) != (uint64_t)rela)
- return false;
+ return -2;
/* Perform relocations */
for (i = 0; i < dt_relacount; i++, rela++) {
uint64_t *t;
if (ELF64_R_TYPE(rela->r_info) != R_PPC64_RELATIVE)
- return false;
+ return -3;
t = (uint64_t *)(rela->r_offset + offset);
*t = rela->r_addend + offset;
}
- return true;
+ return 0;
}
--
1.7.10.4
More information about the Skiboot
mailing list