Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sparc64: vdso2c: Remove symbol handling

There are no handled symbols left.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Andreas Larsson <andreas@gaisler.com>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Acked-by: Andreas Larsson <andreas@gaisler.com>
Link: https://patch.msgid.link/20260304-vdso-sparc64-generic-2-v6-12-d8eb3b0e1410@linutronix.de

authored by

Thomas Weißschuh and committed by
Thomas Gleixner
168d23e5 fb57f3e7

+1 -50
-10
arch/sparc/vdso/vdso2c.c
··· 58 58 59 59 const char *outfilename; 60 60 61 - struct vdso_sym { 62 - const char *name; 63 - int export; 64 - }; 65 - 66 - struct vdso_sym required_syms[] = { 67 - }; 68 - 69 61 __attribute__((format(printf, 1, 2))) __attribute__((noreturn)) 70 62 static void fail(const char *format, ...) 71 63 { ··· 96 104 97 105 #define PUT_BE(x, val) \ 98 106 PBE(x, val, 64, PBE(x, val, 32, PBE(x, val, 16, LAST_PBE(x, val)))) 99 - 100 - #define NSYMS ARRAY_SIZE(required_syms) 101 107 102 108 #define BITSFUNC3(name, bits, suffix) name##bits##suffix 103 109 #define BITSFUNC2(name, bits, suffix) BITSFUNC3(name, bits, suffix)
+1 -40
arch/sparc/vdso/vdso2c.h
··· 17 17 unsigned long mapping_size; 18 18 int i; 19 19 unsigned long j; 20 - ELF(Shdr) *symtab_hdr = NULL, *strtab_hdr; 20 + ELF(Shdr) *symtab_hdr = NULL; 21 21 ELF(Ehdr) *hdr = (ELF(Ehdr) *)raw_addr; 22 22 ELF(Dyn) *dyn = 0, *dyn_end = 0; 23 - INT_BITS syms[NSYMS] = {}; 24 - 25 23 ELF(Phdr) *pt = (ELF(Phdr) *)(raw_addr + GET_BE(&hdr->e_phoff)); 26 24 27 25 /* Walk the segment table. */ ··· 70 72 if (!symtab_hdr) 71 73 fail("no symbol table\n"); 72 74 73 - strtab_hdr = raw_addr + GET_BE(&hdr->e_shoff) + 74 - GET_BE(&hdr->e_shentsize) * GET_BE(&symtab_hdr->sh_link); 75 - 76 - /* Walk the symbol table */ 77 - for (i = 0; 78 - i < GET_BE(&symtab_hdr->sh_size) / GET_BE(&symtab_hdr->sh_entsize); 79 - i++) { 80 - int k; 81 - 82 - ELF(Sym) *sym = raw_addr + GET_BE(&symtab_hdr->sh_offset) + 83 - GET_BE(&symtab_hdr->sh_entsize) * i; 84 - const char *name = raw_addr + GET_BE(&strtab_hdr->sh_offset) + 85 - GET_BE(&sym->st_name); 86 - 87 - for (k = 0; k < NSYMS; k++) { 88 - if (!strcmp(name, required_syms[k].name)) { 89 - if (syms[k]) { 90 - fail("duplicate symbol %s\n", 91 - required_syms[k].name); 92 - } 93 - 94 - /* 95 - * Careful: we use negative addresses, but 96 - * st_value is unsigned, so we rely 97 - * on syms[k] being a signed type of the 98 - * correct width. 99 - */ 100 - syms[k] = GET_BE(&sym->st_value); 101 - } 102 - } 103 - } 104 - 105 75 if (!name) { 106 76 fwrite(stripped_addr, stripped_len, 1, outfile); 107 77 return; ··· 95 129 fprintf(outfile, "const struct vdso_image %s_builtin = {\n", name); 96 130 fprintf(outfile, "\t.data = raw_data,\n"); 97 131 fprintf(outfile, "\t.size = %lu,\n", mapping_size); 98 - for (i = 0; i < NSYMS; i++) { 99 - if (required_syms[i].export && syms[i]) 100 - fprintf(outfile, "\t.sym_%s = %" PRIi64 ",\n", 101 - required_syms[i].name, (int64_t)syms[i]); 102 - } 103 132 fprintf(outfile, "};\n"); 104 133 }