summaryrefslogtreecommitdiffstats
path: root/core/relocate.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-05-07 17:11:40 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-05-15 07:58:18 +1000
commite64108422a2c3f605ecabf088d25509073b4cf7d (patch)
treeb6efd3de2515a4b95960290eadb2e72d47fcbfd2 /core/relocate.c
parentf7fa97c15ae443e051b3dfad57e183b05e400e04 (diff)
downloadblackbird-skiboot-e64108422a2c3f605ecabf088d25509073b4cf7d.tar.gz
blackbird-skiboot-e64108422a2c3f605ecabf088d25509073b4cf7d.zip
Make relocate() return specific error as to what went wrong
Useful in debugging odd problems, such as skiboot > 1MB. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/relocate.c')
-rw-r--r--core/relocate.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/relocate.c b/core/relocate.c
index f6bda372..7255803e 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;
}
OpenPOWER on IntegriCloud