vdso2c.h (8be98d2f2a0a262f8bf8a0bc1fdf522b3c7aab17) vdso2c.h (4c382d723edce1b3c72b55b1b505cf5526a56afc)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * This file is included twice from vdso2c.c. It generates code for 32-bit
4 * and 64-bit vDSOs. We need both for 64-bit builds, since 32-bit vDSOs
5 * are built for 32-bit userspace.
6 */
7
8static void BITSFUNC(copy)(FILE *outfile, const unsigned char *data, size_t len)

--- 165 unchanged lines hidden (view full) ---

174 fwrite(stripped_addr, stripped_len, 1, outfile);
175 return;
176 }
177
178 mapping_size = (stripped_len + 4095) / 4096 * 4096;
179
180 fprintf(outfile, "/* AUTOMATICALLY GENERATED -- DO NOT EDIT */\n\n");
181 fprintf(outfile, "#include <linux/linkage.h>\n");
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * This file is included twice from vdso2c.c. It generates code for 32-bit
4 * and 64-bit vDSOs. We need both for 64-bit builds, since 32-bit vDSOs
5 * are built for 32-bit userspace.
6 */
7
8static void BITSFUNC(copy)(FILE *outfile, const unsigned char *data, size_t len)

--- 165 unchanged lines hidden (view full) ---

174 fwrite(stripped_addr, stripped_len, 1, outfile);
175 return;
176 }
177
178 mapping_size = (stripped_len + 4095) / 4096 * 4096;
179
180 fprintf(outfile, "/* AUTOMATICALLY GENERATED -- DO NOT EDIT */\n\n");
181 fprintf(outfile, "#include <linux/linkage.h>\n");
182 fprintf(outfile, "#include <linux/init.h>\n");
182 fprintf(outfile, "#include <asm/page_types.h>\n");
183 fprintf(outfile, "#include <asm/vdso.h>\n");
184 fprintf(outfile, "\n");
185 fprintf(outfile,
186 "static unsigned char raw_data[%lu] __ro_after_init __aligned(PAGE_SIZE) = {",
187 mapping_size);
188 for (i = 0; i < stripped_len; i++) {
189 if (i % 10 == 0)

--- 23 unchanged lines hidden (view full) ---

213 fprintf(outfile, "\t.extable = extable,\n");
214 }
215
216 for (i = 0; i < NSYMS; i++) {
217 if (required_syms[i].export && syms[i])
218 fprintf(outfile, "\t.sym_%s = %" PRIi64 ",\n",
219 required_syms[i].name, (int64_t)syms[i]);
220 }
183 fprintf(outfile, "#include <asm/page_types.h>\n");
184 fprintf(outfile, "#include <asm/vdso.h>\n");
185 fprintf(outfile, "\n");
186 fprintf(outfile,
187 "static unsigned char raw_data[%lu] __ro_after_init __aligned(PAGE_SIZE) = {",
188 mapping_size);
189 for (i = 0; i < stripped_len; i++) {
190 if (i % 10 == 0)

--- 23 unchanged lines hidden (view full) ---

214 fprintf(outfile, "\t.extable = extable,\n");
215 }
216
217 for (i = 0; i < NSYMS; i++) {
218 if (required_syms[i].export && syms[i])
219 fprintf(outfile, "\t.sym_%s = %" PRIi64 ",\n",
220 required_syms[i].name, (int64_t)syms[i]);
221 }
222 fprintf(outfile, "};\n\n");
223 fprintf(outfile, "static __init int init_%s(void) {\n", image_name);
224 fprintf(outfile, "\treturn init_vdso_image(&%s);\n", image_name);
221 fprintf(outfile, "};\n");
225 fprintf(outfile, "};\n");
226 fprintf(outfile, "subsys_initcall(init_%s);\n", image_name);
227
222}
228}