summaryrefslogtreecommitdiff
path: root/kc
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2022-03-17 11:33:31 +0000
committerAda Christine <adachristine18@gmail.com>2022-03-17 11:34:49 +0000
commit85ea4acf0748fe873dbc796a0b0828837303cff6 (patch)
tree6ec2094325f700d3121712882058212d329f9c64 /kc
parentec4aee35de3446713c6754641cdad82adc011204 (diff)
changes to dynamic initialization
Diffstat (limited to 'kc')
-rw-r--r--kc/dynamic_x86_64.c5
-rw-r--r--kc/kc.ld1
2 files changed, 4 insertions, 2 deletions
diff --git a/kc/dynamic_x86_64.c b/kc/dynamic_x86_64.c
index 22300d6..6b7abd7 100644
--- a/kc/dynamic_x86_64.c
+++ b/kc/dynamic_x86_64.c
@@ -18,14 +18,15 @@ void kc_dynamic_init(void *base, Elf64_Dyn *dyn)
{
switch(dyn->d_tag)
{
- // check for basic relocations first
case DT_RELA:
reladyn.entries = (Elf64_Rela *)(dyn->d_ptr + (uintptr_t)base);
break;
case DT_RELASZ:
reladyn.size = dyn->d_val;
break;
- // might be combined with JMPRELs so check those too
+ // NOTE: ELF x86_64 only uses RELA
+ // possibly support doing REL also for platforms that want it
+ // (am i ever going to use other platforms?)
case DT_JMPREL:
relaplt.entries = (Elf64_Rela *)(dyn->d_ptr + (uintptr_t)base);
break;
diff --git a/kc/kc.ld b/kc/kc.ld
index 22ee6be..dbce342 100644
--- a/kc/kc.ld
+++ b/kc/kc.ld
@@ -76,6 +76,7 @@ SECTIONS
.bss :
{
*(.bss)
+ *(.dynbss)
. = ALIGN(4K);
PROVIDE_HIDDEN(kc_data_end = .);
}