4 #define ETC_LDSO_PATH "/etc/ld-musl-microblaze.path"
6 #define IS_COPY(x) ((x)==R_MICROBLAZE_COPY)
7 #define IS_PLT(x) ((x)==R_MICROBLAZE_JUMP_SLOT)
9 static inline void do_single_reloc(
10 struct dso *self, unsigned char *base_addr,
11 size_t *reloc_addr, int type, size_t addend,
12 Sym *sym, size_t sym_size,
13 struct symdef def, size_t sym_val)
17 case R_MICROBLAZE_GLOB_DAT:
18 case R_MICROBLAZE_JUMP_SLOT:
19 *reloc_addr = sym_val + addend;
21 case R_MICROBLAZE_REL:
22 *reloc_addr = (size_t)base_addr + addend;
24 case R_MICROBLAZE_COPY:
25 memcpy(reloc_addr, (void *)sym_val, sym_size);
27 case R_MICROBLAZE_TLSDTPMOD32:
28 *reloc_addr = def.dso ? def.dso->tls_id : self->tls_id;
30 case R_MICROBLAZE_TLSDTPREL32:
31 *reloc_addr = def.sym->st_value + addend;
37 void __reloc_self(int c, size_t *a, size_t *dynv)
39 char dot = '.', ex = 'x';
42 for (a+=c+1; *a; a++);
43 for (a++; *a; a+=2) if (*a<20) t[*a] = a[1];
44 base = (char *)t[AT_BASE];
45 if (!base) base = (char *)(t[AT_PHDR] & -4096);
46 for (a=dynv; *a; a+=2) if (*a<20) t[*a] = a[1];
48 for (a=(void *)(base+t[DT_RELA]); n; a+=3, n-=12)
49 if (a[1]%256 == R_MICROBLAZE_REL)
50 *(size_t *)(base+a[0]) = (size_t)base + a[2];