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);
31 void __reloc_self(int c, size_t *a, size_t *dynv)
33 char dot = '.', ex = 'x';
36 for (a+=c+1; *a; a++);
37 for (a++; *a; a+=2) if (*a<20) t[*a] = a[1];
38 base = (char *)t[AT_BASE];
39 if (!base) base = (char *)(t[AT_PHDR] & -4096);
40 for (a=dynv; *a; a+=2) if (*a<20) t[*a] = a[1];
42 for (a=(void *)(base+t[DT_RELA]); n; a+=3, n-=12)
43 if (a[1]%256 == R_MICROBLAZE_REL)
44 *(size_t *)(base+a[0]) = (size_t)base + a[2];