summaryrefslogtreecommitdiff
path: root/ldso/ldso/c6x
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2011-04-11 13:21:23 +0200
committerBernd Schmidt <bernds@codesourcery.com>2011-04-11 13:27:03 +0200
commitfeb7ce46ef24f74ebf0235f10127bd49f0c7e675 (patch)
tree3369d611fd697300b39b9f9b6f0cea4f06bd8ae7 /ldso/ldso/c6x
parenteff2d0ba5890b517ef5bc9d0269d6149556c12c8 (diff)
Support dynamic assignment of DSBT_INDEX
For DSBT targets (C6X only at this point), we'd like to support the case where the user did not specify --dsbt-index at link time when building a shared library. The dynamic linker can still assign an index at runtime and fix up the DSBT_INDEX relocs, at the cost of startup time and memory space. Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Diffstat (limited to 'ldso/ldso/c6x')
-rw-r--r--ldso/ldso/c6x/elfinterp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ldso/ldso/c6x/elfinterp.c b/ldso/ldso/c6x/elfinterp.c
index 7c79171ce..f5d3ad41e 100644
--- a/ldso/ldso/c6x/elfinterp.c
+++ b/ldso/ldso/c6x/elfinterp.c
@@ -198,6 +198,10 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
new_val = sym_val;
*reloc_addr = sym_val;
break;
+ case R_C6000_DSBT_INDEX:
+ new_val = (old_val & ~0x007fff00) | ((tpnt->loadaddr.map->dsbt_index & 0x7fff) << 8);
+ *reloc_addr = new_val;
+ break;
case R_C6000_ABS_L16:
new_val = (old_val & ~0x007fff80) | ((sym_val & 0xffff) << 7);
*reloc_addr = new_val;
@@ -224,7 +228,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
(char *)symbol_addr,
symtab[symtab_index].st_size);
}
- break;
+ return 0;
default:
return -1; /*call _dl_exit(1) */
}