diff options
| author | Alexander Kanavin <alex.kanavin@gmail.com> | 2023-01-04 12:04:35 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-06 12:03:47 +0000 |
| commit | 4b213e109c67825e6192e9b912b71c9dc1740ff2 (patch) | |
| tree | d45da076e567dc5bb7e4e09e3ba415e88bfd93b6 /meta | |
| parent | 06f5a0ffa0ec6383fce6ecfbe3bc1b8e807ab928 (diff) | |
| download | poky-4b213e109c67825e6192e9b912b71c9dc1740ff2.tar.gz | |
nasm: update 2.15.05 -> 2.16.01
adjust 0002-Add-debug-prefix-map-option.patch to account for
https://github.com/netwide-assembler/nasm/commit/f2a6eb4aaca361c1ebe374bf07765790eecf8869
and add a chunk to it that guarantees source paths not leaking into debug sections
that list source filenames.
(From OE-Core rev: 0d7d96fb0b215e56f6dacd4dd44b12bbd7ecdd34)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch | 18 | ||||
| -rw-r--r-- | meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch | 74 | ||||
| -rw-r--r-- | meta/recipes-devtools/nasm/nasm_2.16.01.bb (renamed from meta/recipes-devtools/nasm/nasm_2.15.05.bb) | 2 |
3 files changed, 63 insertions, 31 deletions
diff --git a/meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch b/meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch index 0ede8a8328..1b8e947c56 100644 --- a/meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch +++ b/meta/recipes-devtools/nasm/nasm/0001-stdlib-Add-strlcat.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 1c5023002bad3a5b0bbc181fdb324160beace733 Mon Sep 17 00:00:00 2001 | 1 | From 680220e772dfa381829983fa73b915416f676894 Mon Sep 17 00:00:00 2001 |
| 2 | From: Joshua Watt <JPEWhacker@gmail.com> | 2 | From: Joshua Watt <JPEWhacker@gmail.com> |
| 3 | Date: Tue, 19 Nov 2019 12:47:30 -0600 | 3 | Date: Tue, 19 Nov 2019 12:47:30 -0600 |
| 4 | Subject: [PATCH] stdlib: Add strlcat | 4 | Subject: [PATCH] stdlib: Add strlcat |
| @@ -17,23 +17,23 @@ Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> | |||
| 17 | create mode 100644 stdlib/strlcat.c | 17 | create mode 100644 stdlib/strlcat.c |
| 18 | 18 | ||
| 19 | diff --git a/Makefile.in b/Makefile.in | 19 | diff --git a/Makefile.in b/Makefile.in |
| 20 | index bfae1f8..156dc4c 100644 | 20 | index b85ebee..045fabe 100644 |
| 21 | --- a/Makefile.in | 21 | --- a/Makefile.in |
| 22 | +++ b/Makefile.in | 22 | +++ b/Makefile.in |
| 23 | @@ -101,7 +101,7 @@ NASM = asm/nasm.$(O) | 23 | @@ -104,7 +104,7 @@ PROGOBJ = $(NASM) $(NDISASM) |
| 24 | NDISASM = disasm/ndisasm.$(O) | 24 | PROGS = nasm$(X) ndisasm$(X) |
| 25 | 25 | ||
| 26 | LIBOBJ = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \ | 26 | LIBOBJ_NW = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \ |
| 27 | - stdlib/strnlen.$(O) stdlib/strrchrnul.$(O) \ | 27 | - stdlib/strnlen.$(O) stdlib/strrchrnul.$(O) \ |
| 28 | + stdlib/strnlen.$(O) stdlib/strrchrnul.$(O) stdlib/strlcat.$(O) \ | 28 | + stdlib/strnlen.$(O) stdlib/strrchrnul.$(O) stdlib/strlcat.$(O) \ |
| 29 | \ | 29 | \ |
| 30 | nasmlib/ver.$(O) \ | 30 | nasmlib/ver.$(O) \ |
| 31 | nasmlib/alloc.$(O) nasmlib/asprintf.$(O) nasmlib/errfile.$(O) \ | 31 | nasmlib/alloc.$(O) nasmlib/asprintf.$(O) nasmlib/errfile.$(O) \ |
| 32 | diff --git a/configure.ac b/configure.ac | 32 | diff --git a/configure.ac b/configure.ac |
| 33 | index 7b72769..14fd033 100644 | 33 | index 42cd198..e206338 100644 |
| 34 | --- a/configure.ac | 34 | --- a/configure.ac |
| 35 | +++ b/configure.ac | 35 | +++ b/configure.ac |
| 36 | @@ -234,6 +234,7 @@ PA_FUNC_SNPRINTF | 36 | @@ -236,6 +236,7 @@ PA_FUNC_SNPRINTF |
| 37 | PA_FUNC_VSNPRINTF | 37 | PA_FUNC_VSNPRINTF |
| 38 | AC_CHECK_FUNCS([strlcpy]) | 38 | AC_CHECK_FUNCS([strlcpy]) |
| 39 | AC_CHECK_FUNCS([strrchrnul]) | 39 | AC_CHECK_FUNCS([strrchrnul]) |
| @@ -41,7 +41,7 @@ index 7b72769..14fd033 100644 | |||
| 41 | 41 | ||
| 42 | dnl These types are POSIX-specific, and Windows does it differently... | 42 | dnl These types are POSIX-specific, and Windows does it differently... |
| 43 | AC_CHECK_TYPES([struct _stati64]) | 43 | AC_CHECK_TYPES([struct _stati64]) |
| 44 | @@ -253,6 +254,7 @@ AC_CHECK_DECLS(strsep) | 44 | @@ -255,6 +256,7 @@ AC_CHECK_DECLS(strsep) |
| 45 | AC_CHECK_DECLS(strlcpy) | 45 | AC_CHECK_DECLS(strlcpy) |
| 46 | AC_CHECK_DECLS(strnlen) | 46 | AC_CHECK_DECLS(strnlen) |
| 47 | AC_CHECK_DECLS(strrchrnul) | 47 | AC_CHECK_DECLS(strrchrnul) |
| @@ -50,7 +50,7 @@ index 7b72769..14fd033 100644 | |||
| 50 | dnl Check for missing types | 50 | dnl Check for missing types |
| 51 | AC_TYPE_UINTPTR_T | 51 | AC_TYPE_UINTPTR_T |
| 52 | diff --git a/include/compiler.h b/include/compiler.h | 52 | diff --git a/include/compiler.h b/include/compiler.h |
| 53 | index b4fd3a8..7fb4821 100644 | 53 | index 407c160..b64da6a 100644 |
| 54 | --- a/include/compiler.h | 54 | --- a/include/compiler.h |
| 55 | +++ b/include/compiler.h | 55 | +++ b/include/compiler.h |
| 56 | @@ -169,6 +169,10 @@ size_t strlcpy(char *, const char *, size_t); | 56 | @@ -169,6 +169,10 @@ size_t strlcpy(char *, const char *, size_t); |
diff --git a/meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch b/meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch index 9f4c8dc0bd..84fcca0fe1 100644 --- a/meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch +++ b/meta/recipes-devtools/nasm/nasm/0002-Add-debug-prefix-map-option.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 81d6519499dcfebe7d21e65e002a8885a4e8d852 Mon Sep 17 00:00:00 2001 | 1 | From e28c8883050d34d18ee2d66dfeece51e13adb6d5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Joshua Watt <JPEWhacker@gmail.com> | 2 | From: Joshua Watt <JPEWhacker@gmail.com> |
| 3 | Date: Tue, 19 Nov 2019 13:12:17 -0600 | 3 | Date: Tue, 19 Nov 2019 13:12:17 -0600 |
| 4 | Subject: [PATCH] Add --debug-prefix-map option | 4 | Subject: [PATCH] Add --debug-prefix-map option |
| @@ -17,17 +17,17 @@ Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> | |||
| 17 | nasmlib/filename.c | 20 ++++++++++++++++++++ | 17 | nasmlib/filename.c | 20 ++++++++++++++++++++ |
| 18 | output/outas86.c | 4 +++- | 18 | output/outas86.c | 4 +++- |
| 19 | output/outcoff.c | 4 ++-- | 19 | output/outcoff.c | 4 ++-- |
| 20 | output/outelf.c | 2 +- | 20 | output/outelf.c | 13 ++++++++----- |
| 21 | output/outieee.c | 2 +- | 21 | output/outieee.c | 2 +- |
| 22 | output/outobj.c | 2 +- | 22 | output/outobj.c | 2 +- |
| 23 | stdlib/strlcat.c | 2 +- | 23 | stdlib/strlcat.c | 2 +- |
| 24 | test/elfdebugprefix.asm | 6 ++++++ | 24 | test/elfdebugprefix.asm | 6 ++++++ |
| 25 | test/performtest.pl | 12 ++++++++++-- | 25 | test/performtest.pl | 12 ++++++++++-- |
| 26 | 12 files changed, 82 insertions(+), 9 deletions(-) | 26 | 12 files changed, 89 insertions(+), 13 deletions(-) |
| 27 | create mode 100644 test/elfdebugprefix.asm | 27 | create mode 100644 test/elfdebugprefix.asm |
| 28 | 28 | ||
| 29 | diff --git a/asm/nasm.c b/asm/nasm.c | 29 | diff --git a/asm/nasm.c b/asm/nasm.c |
| 30 | index e5ae89a..7a7f8b4 100644 | 30 | index 76c70f6..08ff119 100644 |
| 31 | --- a/asm/nasm.c | 31 | --- a/asm/nasm.c |
| 32 | +++ b/asm/nasm.c | 32 | +++ b/asm/nasm.c |
| 33 | @@ -939,6 +939,7 @@ enum text_options { | 33 | @@ -939,6 +939,7 @@ enum text_options { |
| @@ -46,7 +46,7 @@ index e5ae89a..7a7f8b4 100644 | |||
| 46 | {"reproducible", OPT_REPRODUCIBLE, ARG_NO, 0}, | 46 | {"reproducible", OPT_REPRODUCIBLE, ARG_NO, 0}, |
| 47 | {NULL, OPT_BOGUS, ARG_NO, 0} | 47 | {NULL, OPT_BOGUS, ARG_NO, 0} |
| 48 | }; | 48 | }; |
| 49 | @@ -1337,6 +1339,26 @@ static bool process_arg(char *p, char *q, int pass) | 49 | @@ -1335,6 +1337,26 @@ static bool process_arg(char *p, char *q, int pass) |
| 50 | case OPT_REPRODUCIBLE: | 50 | case OPT_REPRODUCIBLE: |
| 51 | reproducible = true; | 51 | reproducible = true; |
| 52 | break; | 52 | break; |
| @@ -73,7 +73,7 @@ index e5ae89a..7a7f8b4 100644 | |||
| 73 | case OPT_HELP: | 73 | case OPT_HELP: |
| 74 | help(stdout); | 74 | help(stdout); |
| 75 | exit(0); | 75 | exit(0); |
| 76 | @@ -2304,6 +2326,8 @@ static void help(FILE *out) | 76 | @@ -2298,6 +2320,8 @@ static void help(FILE *out) |
| 77 | " -w-x disable warning x (also -Wno-x)\n" | 77 | " -w-x disable warning x (also -Wno-x)\n" |
| 78 | " -w[+-]error promote all warnings to errors (also -Werror)\n" | 78 | " -w[+-]error promote all warnings to errors (also -Werror)\n" |
| 79 | " -w[+-]error=x promote warning x to errors (also -Werror=x)\n" | 79 | " -w[+-]error=x promote warning x to errors (also -Werror=x)\n" |
| @@ -83,7 +83,7 @@ index e5ae89a..7a7f8b4 100644 | |||
| 83 | 83 | ||
| 84 | fprintf(out, " %-20s %s\n", | 84 | fprintf(out, " %-20s %s\n", |
| 85 | diff --git a/include/nasmlib.h b/include/nasmlib.h | 85 | diff --git a/include/nasmlib.h b/include/nasmlib.h |
| 86 | index 438178d..4c3e90d 100644 | 86 | index 87a7fc6..a3e5144 100644 |
| 87 | --- a/include/nasmlib.h | 87 | --- a/include/nasmlib.h |
| 88 | +++ b/include/nasmlib.h | 88 | +++ b/include/nasmlib.h |
| 89 | @@ -250,10 +250,19 @@ int64_t readstrnum(char *str, int length, bool *warn); | 89 | @@ -250,10 +250,19 @@ int64_t readstrnum(char *str, int length, bool *warn); |
| @@ -107,7 +107,7 @@ index 438178d..4c3e90d 100644 | |||
| 107 | /* | 107 | /* |
| 108 | * Utility macros... | 108 | * Utility macros... |
| 109 | diff --git a/nasm.txt b/nasm.txt | 109 | diff --git a/nasm.txt b/nasm.txt |
| 110 | index cc7fa27..d3485c9 100644 | 110 | index 950c361..784618c 100644 |
| 111 | --- a/nasm.txt | 111 | --- a/nasm.txt |
| 112 | +++ b/nasm.txt | 112 | +++ b/nasm.txt |
| 113 | @@ -147,6 +147,10 @@ OPTIONS | 113 | @@ -147,6 +147,10 @@ OPTIONS |
| @@ -179,10 +179,10 @@ index 54b22f8..c4a412c 100644 | |||
| 179 | 179 | ||
| 180 | static void as86_cleanup(void) | 180 | static void as86_cleanup(void) |
| 181 | diff --git a/output/outcoff.c b/output/outcoff.c | 181 | diff --git a/output/outcoff.c b/output/outcoff.c |
| 182 | index 58fa024..14baf7b 100644 | 182 | index c2b4eb6..e242db2 100644 |
| 183 | --- a/output/outcoff.c | 183 | --- a/output/outcoff.c |
| 184 | +++ b/output/outcoff.c | 184 | +++ b/output/outcoff.c |
| 185 | @@ -1072,14 +1072,14 @@ static void coff_symbol(char *name, int32_t strpos, int32_t value, | 185 | @@ -1259,7 +1259,7 @@ static void coff_symbol(char *name, int32_t strpos, int32_t value, |
| 186 | 186 | ||
| 187 | static void coff_write_symbols(void) | 187 | static void coff_write_symbols(void) |
| 188 | { | 188 | { |
| @@ -191,29 +191,61 @@ index 58fa024..14baf7b 100644 | |||
| 191 | uint32_t i; | 191 | uint32_t i; |
| 192 | 192 | ||
| 193 | /* | 193 | /* |
| 194 | * The `.file' record, and the file name auxiliary record. | 194 | @@ -1269,7 +1269,7 @@ static void coff_write_symbols(void) |
| 195 | */ | 195 | if (reproducible) |
| 196 | coff_symbol(".file", 0L, 0L, -2, 0, 0x67, 1); | 196 | memset(filename, 0, 18); |
| 197 | - strncpy(filename, inname, 18); | 197 | else |
| 198 | + filename_debug_remap(filename, inname, 19); | 198 | - strncpy(filename, inname, 18); |
| 199 | + filename_debug_remap(filename, inname, 19); | ||
| 199 | nasm_write(filename, 18, ofile); | 200 | nasm_write(filename, 18, ofile); |
| 200 | 201 | ||
| 201 | /* | 202 | /* |
| 202 | diff --git a/output/outelf.c b/output/outelf.c | 203 | diff --git a/output/outelf.c b/output/outelf.c |
| 203 | index 61af020..1292958 100644 | 204 | index ad8d210..29f1dc1 100644 |
| 204 | --- a/output/outelf.c | 205 | --- a/output/outelf.c |
| 205 | +++ b/output/outelf.c | 206 | +++ b/output/outelf.c |
| 206 | @@ -553,7 +553,7 @@ static void elf_init(void) | 207 | @@ -546,8 +546,8 @@ static void elf_init(void) |
| 207 | }; | ||
| 208 | const char * const *p; | 208 | const char * const *p; |
| 209 | const char * cur_path = nasm_realpath(inname); | ||
| 209 | 210 | ||
| 210 | - strlcpy(elf_module, inname, sizeof(elf_module)); | 211 | - strlcpy(elf_module, inname, sizeof(elf_module)); |
| 212 | - strlcpy(elf_dir, nasm_dirname(cur_path), sizeof(elf_dir)); | ||
| 211 | + filename_debug_remap(elf_module, inname, sizeof(elf_module)); | 213 | + filename_debug_remap(elf_module, inname, sizeof(elf_module)); |
| 214 | + filename_debug_remap(elf_dir, nasm_dirname(cur_path), sizeof(elf_dir)); | ||
| 212 | sects = NULL; | 215 | sects = NULL; |
| 213 | nsects = sectlen = 0; | 216 | nsects = sectlen = 0; |
| 214 | syms = saa_init((int32_t)sizeof(struct elf_symbol)); | 217 | syms = saa_init((int32_t)sizeof(struct elf_symbol)); |
| 218 | @@ -3590,13 +3590,17 @@ static void dwarf_findfile(const char * fname) | ||
| 219 | if (dwarf_clist && !(strcmp(fname, dwarf_clist->filename))) | ||
| 220 | return; | ||
| 221 | |||
| 222 | + char * fname_remapped = nasm_malloc(FILENAME_MAX); | ||
| 223 | + filename_debug_remap(fname_remapped,fname,FILENAME_MAX); | ||
| 224 | + | ||
| 225 | /* search for match */ | ||
| 226 | match = 0; | ||
| 227 | if (dwarf_flist) { | ||
| 228 | match = dwarf_flist; | ||
| 229 | for (finx = 0; finx < dwarf_numfiles; finx++) { | ||
| 230 | - if (!(strcmp(fname, match->filename))) { | ||
| 231 | + if (!(strcmp(fname_remapped, match->filename))) { | ||
| 232 | dwarf_clist = match; | ||
| 233 | + nasm_free(fname_remapped); | ||
| 234 | return; | ||
| 235 | } | ||
| 236 | match = match->next; | ||
| 237 | @@ -3607,8 +3611,7 @@ static void dwarf_findfile(const char * fname) | ||
| 238 | dwarf_clist = nasm_malloc(sizeof(struct linelist)); | ||
| 239 | dwarf_numfiles++; | ||
| 240 | dwarf_clist->line = dwarf_numfiles; | ||
| 241 | - dwarf_clist->filename = nasm_malloc(strlen(fname) + 1); | ||
| 242 | - strcpy(dwarf_clist->filename,fname); | ||
| 243 | + dwarf_clist->filename = fname_remapped; | ||
| 244 | dwarf_clist->next = 0; | ||
| 245 | if (!dwarf_flist) { /* if first entry */ | ||
| 246 | dwarf_flist = dwarf_elist = dwarf_clist; | ||
| 215 | diff --git a/output/outieee.c b/output/outieee.c | 247 | diff --git a/output/outieee.c b/output/outieee.c |
| 216 | index 6d6d4b2..cdb8333 100644 | 248 | index 7ba9036..796e5af 100644 |
| 217 | --- a/output/outieee.c | 249 | --- a/output/outieee.c |
| 218 | +++ b/output/outieee.c | 250 | +++ b/output/outieee.c |
| 219 | @@ -207,7 +207,7 @@ static void ieee_unqualified_name(char *, char *); | 251 | @@ -207,7 +207,7 @@ static void ieee_unqualified_name(char *, char *); |
| @@ -226,7 +258,7 @@ index 6d6d4b2..cdb8333 100644 | |||
| 226 | fpubhead = NULL; | 258 | fpubhead = NULL; |
| 227 | fpubtail = &fpubhead; | 259 | fpubtail = &fpubhead; |
| 228 | diff --git a/output/outobj.c b/output/outobj.c | 260 | diff --git a/output/outobj.c b/output/outobj.c |
| 229 | index 56b43f9..fefea94 100644 | 261 | index 281839d..fc336c1 100644 |
| 230 | --- a/output/outobj.c | 262 | --- a/output/outobj.c |
| 231 | +++ b/output/outobj.c | 263 | +++ b/output/outobj.c |
| 232 | @@ -644,7 +644,7 @@ static enum directive_result obj_directive(enum directive, char *); | 264 | @@ -644,7 +644,7 @@ static enum directive_result obj_directive(enum directive, char *); |
| @@ -264,7 +296,7 @@ index 0000000..a67ba29 | |||
| 264 | + ret | 296 | + ret |
| 265 | + | 297 | + |
| 266 | diff --git a/test/performtest.pl b/test/performtest.pl | 298 | diff --git a/test/performtest.pl b/test/performtest.pl |
| 267 | index f7865b3..096f960 100755 | 299 | index 46b1bdf..2426848 100755 |
| 268 | --- a/test/performtest.pl | 300 | --- a/test/performtest.pl |
| 269 | +++ b/test/performtest.pl | 301 | +++ b/test/performtest.pl |
| 270 | @@ -42,14 +42,22 @@ sub perform { | 302 | @@ -42,14 +42,22 @@ sub perform { |
diff --git a/meta/recipes-devtools/nasm/nasm_2.15.05.bb b/meta/recipes-devtools/nasm/nasm_2.16.01.bb index edc17aeebf..219cc49360 100644 --- a/meta/recipes-devtools/nasm/nasm_2.15.05.bb +++ b/meta/recipes-devtools/nasm/nasm_2.16.01.bb | |||
| @@ -10,7 +10,7 @@ SRC_URI = "http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 \ | |||
| 10 | file://0002-Add-debug-prefix-map-option.patch \ | 10 | file://0002-Add-debug-prefix-map-option.patch \ |
| 11 | " | 11 | " |
| 12 | 12 | ||
| 13 | SRC_URI[sha256sum] = "3c4b8339e5ab54b1bcb2316101f8985a5da50a3f9e504d43fa6f35668bee2fd0" | 13 | SRC_URI[sha256sum] = "35b6ad2ee048d41c4779f073f3efca7762a822b7d2d4ef4e8df24cf65747bb2e" |
| 14 | 14 | ||
| 15 | EXTRA_AUTORECONF:append = " -I autoconf/m4" | 15 | EXTRA_AUTORECONF:append = " -I autoconf/m4" |
| 16 | 16 | ||
