diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-07-18 21:22:03 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-24 16:33:46 +0100 |
commit | 433d240084edd47f894b310a105ca91140b29deb (patch) | |
tree | 21095d61dcdc68a2bd07225ed273a5dce653f449 /meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch | |
parent | a926dd6cdd66ada6febf9638a1916dc988c6e1c8 (diff) | |
download | poky-433d240084edd47f894b310a105ca91140b29deb.tar.gz |
binutils: Upgrade to 2.37 branch
This is next/latest release branch for binutils
Drop backports and CVE fixes which already are applied upstream
bfd_stdint.h has been removed in favor of using stdint.h
(From OE-Core rev: 08cd144fc4b5ac34ff99f71b1d825cbff96b642c)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch b/meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch index 5c148eaa95..c724dfd7a7 100644 --- a/meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch +++ b/meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From bb48edf1a87bbc711e8978dd1e9112fe953dc1bf Mon Sep 17 00:00:00 2001 | 1 | From 99e1565b9d2b929d4ee4e9da6f63766b22b23fc3 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Fri, 15 Jan 2016 06:31:09 +0000 | 3 | Date: Fri, 15 Jan 2016 06:31:09 +0000 |
4 | Subject: [PATCH] warn for uses of system directories when cross linking | 4 | Subject: [PATCH] warn for uses of system directories when cross linking |
@@ -62,11 +62,9 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
62 | ld/lexsup.c | 16 ++++++++++++++++ | 62 | ld/lexsup.c | 16 ++++++++++++++++ |
63 | 9 files changed, 86 insertions(+) | 63 | 9 files changed, 86 insertions(+) |
64 | 64 | ||
65 | diff --git a/ld/config.in b/ld/config.in | ||
66 | index 7b60d778587..37b8e9b6f6c 100644 | ||
67 | --- a/ld/config.in | 65 | --- a/ld/config.in |
68 | +++ b/ld/config.in | 66 | +++ b/ld/config.in |
69 | @@ -40,6 +40,9 @@ | 67 | @@ -43,6 +43,9 @@ |
70 | language is requested. */ | 68 | language is requested. */ |
71 | #undef ENABLE_NLS | 69 | #undef ENABLE_NLS |
72 | 70 | ||
@@ -76,11 +74,9 @@ index 7b60d778587..37b8e9b6f6c 100644 | |||
76 | /* Additional extension a shared object might have. */ | 74 | /* Additional extension a shared object might have. */ |
77 | #undef EXTRA_SHLIB_EXTENSION | 75 | #undef EXTRA_SHLIB_EXTENSION |
78 | 76 | ||
79 | diff --git a/ld/configure b/ld/configure | ||
80 | index b0969791959..50bb04ce6a8 100755 | ||
81 | --- a/ld/configure | 77 | --- a/ld/configure |
82 | +++ b/ld/configure | 78 | +++ b/ld/configure |
83 | @@ -828,6 +828,7 @@ with_lib_path | 79 | @@ -829,6 +829,7 @@ with_lib_path |
84 | enable_targets | 80 | enable_targets |
85 | enable_64_bit_bfd | 81 | enable_64_bit_bfd |
86 | with_sysroot | 82 | with_sysroot |
@@ -88,8 +84,8 @@ index b0969791959..50bb04ce6a8 100755 | |||
88 | enable_gold | 84 | enable_gold |
89 | enable_got | 85 | enable_got |
90 | enable_compressed_debug_sections | 86 | enable_compressed_debug_sections |
91 | @@ -1496,6 +1497,8 @@ Optional Features: | 87 | @@ -1498,6 +1499,8 @@ Optional Features: |
92 | --disable-largefile omit support for large files | 88 | --enable-checking enable run-time checks |
93 | --enable-targets alternative target configurations | 89 | --enable-targets alternative target configurations |
94 | --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) | 90 | --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) |
95 | + --enable-poison-system-directories | 91 | + --enable-poison-system-directories |
@@ -97,7 +93,7 @@ index b0969791959..50bb04ce6a8 100755 | |||
97 | --enable-gold[=ARG] build gold [ARG={default,yes,no}] | 93 | --enable-gold[=ARG] build gold [ARG={default,yes,no}] |
98 | --enable-got=<type> GOT handling scheme (target, single, negative, | 94 | --enable-got=<type> GOT handling scheme (target, single, negative, |
99 | multigot) | 95 | multigot) |
100 | @@ -15820,6 +15823,19 @@ fi | 96 | @@ -15215,6 +15218,19 @@ fi |
101 | 97 | ||
102 | 98 | ||
103 | 99 | ||
@@ -117,11 +113,9 @@ index b0969791959..50bb04ce6a8 100755 | |||
117 | # Check whether --enable-gold was given. | 113 | # Check whether --enable-gold was given. |
118 | if test "${enable_gold+set}" = set; then : | 114 | if test "${enable_gold+set}" = set; then : |
119 | enableval=$enable_gold; case "${enableval}" in | 115 | enableval=$enable_gold; case "${enableval}" in |
120 | diff --git a/ld/configure.ac b/ld/configure.ac | ||
121 | index c9c69ab9245..59dab0a6ac4 100644 | ||
122 | --- a/ld/configure.ac | 116 | --- a/ld/configure.ac |
123 | +++ b/ld/configure.ac | 117 | +++ b/ld/configure.ac |
124 | @@ -94,6 +94,16 @@ AC_SUBST(use_sysroot) | 118 | @@ -106,6 +106,16 @@ AC_SUBST(use_sysroot) |
125 | AC_SUBST(TARGET_SYSTEM_ROOT) | 119 | AC_SUBST(TARGET_SYSTEM_ROOT) |
126 | AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) | 120 | AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) |
127 | 121 | ||
@@ -138,30 +132,26 @@ index c9c69ab9245..59dab0a6ac4 100644 | |||
138 | dnl Use --enable-gold to decide if this linker should be the default. | 132 | dnl Use --enable-gold to decide if this linker should be the default. |
139 | dnl "install_as_default" is set to false if gold is the default linker. | 133 | dnl "install_as_default" is set to false if gold is the default linker. |
140 | dnl "installed_linker" is the installed BFD linker name. | 134 | dnl "installed_linker" is the installed BFD linker name. |
141 | diff --git a/ld/ld.h b/ld/ld.h | ||
142 | index 93f5af92c7d..ff7f71a7b66 100644 | ||
143 | --- a/ld/ld.h | 135 | --- a/ld/ld.h |
144 | +++ b/ld/ld.h | 136 | +++ b/ld/ld.h |
145 | @@ -166,6 +166,14 @@ typedef struct | 137 | @@ -162,6 +162,14 @@ typedef struct |
146 | in the linker script. */ | 138 | in the linker script. */ |
147 | bfd_boolean force_group_allocation; | 139 | bool force_group_allocation; |
148 | 140 | ||
149 | + /* If TRUE (the default) warn for uses of system directories when | 141 | + /* If TRUE (the default) warn for uses of system directories when |
150 | + cross linking. */ | 142 | + cross linking. */ |
151 | + bfd_boolean poison_system_directories; | 143 | + bool poison_system_directories; |
152 | + | 144 | + |
153 | + /* If TRUE (default FALSE) give an error for uses of system | 145 | + /* If TRUE (default FALSE) give an error for uses of system |
154 | + directories when cross linking instead of a warning. */ | 146 | + directories when cross linking instead of a warning. */ |
155 | + bfd_boolean error_poison_system_directories; | 147 | + bool error_poison_system_directories; |
156 | + | 148 | + |
157 | /* Big or little endian as set on command line. */ | 149 | /* Big or little endian as set on command line. */ |
158 | enum endian_enum endian; | 150 | enum endian_enum endian; |
159 | 151 | ||
160 | diff --git a/ld/ld.texi b/ld/ld.texi | ||
161 | index 7a602b9c6ab..cccbfbab3bb 100644 | ||
162 | --- a/ld/ld.texi | 152 | --- a/ld/ld.texi |
163 | +++ b/ld/ld.texi | 153 | +++ b/ld/ld.texi |
164 | @@ -2810,6 +2810,18 @@ string identifying the original linked file does not change. | 154 | @@ -2863,6 +2863,18 @@ string identifying the original linked f |
165 | 155 | ||
166 | Passing @code{none} for @var{style} disables the setting from any | 156 | Passing @code{none} for @var{style} disables the setting from any |
167 | @code{--build-id} options earlier on the command line. | 157 | @code{--build-id} options earlier on the command line. |
@@ -180,11 +170,9 @@ index 7a602b9c6ab..cccbfbab3bb 100644 | |||
180 | @end table | 170 | @end table |
181 | 171 | ||
182 | @c man end | 172 | @c man end |
183 | diff --git a/ld/ldfile.c b/ld/ldfile.c | ||
184 | index 81cb86d51e2..cd5c2752679 100644 | ||
185 | --- a/ld/ldfile.c | 173 | --- a/ld/ldfile.c |
186 | +++ b/ld/ldfile.c | 174 | +++ b/ld/ldfile.c |
187 | @@ -117,6 +117,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline) | 175 | @@ -117,6 +117,23 @@ ldfile_add_library_path (const char *nam |
188 | new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); | 176 | new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); |
189 | else | 177 | else |
190 | new_dirs->name = xstrdup (name); | 178 | new_dirs->name = xstrdup (name); |
@@ -208,11 +196,9 @@ index 81cb86d51e2..cd5c2752679 100644 | |||
208 | } | 196 | } |
209 | 197 | ||
210 | /* Try to open a BFD for a lang_input_statement. */ | 198 | /* Try to open a BFD for a lang_input_statement. */ |
211 | diff --git a/ld/ldlex.h b/ld/ldlex.h | ||
212 | index b0101028321..77f5accb5d9 100644 | ||
213 | --- a/ld/ldlex.h | 199 | --- a/ld/ldlex.h |
214 | +++ b/ld/ldlex.h | 200 | +++ b/ld/ldlex.h |
215 | @@ -161,6 +161,8 @@ enum option_values | 201 | @@ -163,6 +163,8 @@ enum option_values |
216 | OPTION_CTF_VARIABLES, | 202 | OPTION_CTF_VARIABLES, |
217 | OPTION_NO_CTF_VARIABLES, | 203 | OPTION_NO_CTF_VARIABLES, |
218 | OPTION_CTF_SHARE_TYPES, | 204 | OPTION_CTF_SHARE_TYPES, |
@@ -221,24 +207,38 @@ index b0101028321..77f5accb5d9 100644 | |||
221 | }; | 207 | }; |
222 | 208 | ||
223 | /* The initial parser states. */ | 209 | /* The initial parser states. */ |
224 | diff --git a/ld/ldmain.c b/ld/ldmain.c | ||
225 | index 080b1c4c6c2..78d8a2df278 100644 | ||
226 | --- a/ld/ldmain.c | 210 | --- a/ld/ldmain.c |
227 | +++ b/ld/ldmain.c | 211 | +++ b/ld/ldmain.c |
228 | @@ -324,6 +324,8 @@ main (int argc, char **argv) | 212 | @@ -321,6 +321,8 @@ main (int argc, char **argv) |
229 | command_line.warn_mismatch = TRUE; | 213 | command_line.warn_mismatch = true; |
230 | command_line.warn_search_mismatch = TRUE; | 214 | command_line.warn_search_mismatch = true; |
231 | command_line.check_section_addresses = -1; | 215 | command_line.check_section_addresses = -1; |
232 | + command_line.poison_system_directories = TRUE; | 216 | + command_line.poison_system_directories = true; |
233 | + command_line.error_poison_system_directories = FALSE; | 217 | + command_line.error_poison_system_directories = false; |
234 | 218 | ||
235 | /* We initialize DEMANGLING based on the environment variable | 219 | /* We initialize DEMANGLING based on the environment variable |
236 | COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the | 220 | COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the |
237 | diff --git a/ld/lexsup.c b/ld/lexsup.c | 221 | @@ -1444,7 +1446,7 @@ undefined_symbol (struct bfd_link_info * |
238 | index f005a58a045..5eb8439fef7 100644 | 222 | argv[1] = "undefined-symbol"; |
223 | argv[2] = (char *) name; | ||
224 | argv[3] = NULL; | ||
225 | - | ||
226 | + | ||
227 | if (verbose) | ||
228 | einfo (_("%P: About to run error handling script '%s' with arguments: '%s' '%s'\n"), | ||
229 | argv[0], argv[1], argv[2]); | ||
230 | @@ -1465,7 +1467,7 @@ undefined_symbol (struct bfd_link_info * | ||
231 | carry on to issue the normal error message. */ | ||
232 | } | ||
233 | #endif /* SUPPORT_ERROR_HANDLING_SCRIPT */ | ||
234 | - | ||
235 | + | ||
236 | if (section != NULL) | ||
237 | { | ||
238 | if (error_count < MAX_ERRORS_IN_A_ROW) | ||
239 | --- a/ld/lexsup.c | 239 | --- a/ld/lexsup.c |
240 | +++ b/ld/lexsup.c | 240 | +++ b/ld/lexsup.c |
241 | @@ -591,6 +591,14 @@ static const struct ld_option ld_options[] = | 241 | @@ -595,6 +595,14 @@ static const struct ld_option ld_options |
242 | " <method> is: share-unconflicted (default),\n" | 242 | " <method> is: share-unconflicted (default),\n" |
243 | " share-duplicated"), | 243 | " share-duplicated"), |
244 | TWO_DASHES }, | 244 | TWO_DASHES }, |
@@ -253,16 +253,16 @@ index f005a58a045..5eb8439fef7 100644 | |||
253 | }; | 253 | }; |
254 | 254 | ||
255 | #define OPTION_COUNT ARRAY_SIZE (ld_options) | 255 | #define OPTION_COUNT ARRAY_SIZE (ld_options) |
256 | @@ -1676,6 +1684,14 @@ parse_args (unsigned argc, char **argv) | 256 | @@ -1686,6 +1694,14 @@ parse_args (unsigned argc, char **argv) |
257 | config.print_map_discarded = TRUE; | 257 | config.print_map_discarded = true; |
258 | break; | 258 | break; |
259 | 259 | ||
260 | + case OPTION_NO_POISON_SYSTEM_DIRECTORIES: | 260 | + case OPTION_NO_POISON_SYSTEM_DIRECTORIES: |
261 | + command_line.poison_system_directories = FALSE; | 261 | + command_line.poison_system_directories = false; |
262 | + break; | 262 | + break; |
263 | + | 263 | + |
264 | + case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: | 264 | + case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: |
265 | + command_line.error_poison_system_directories = TRUE; | 265 | + command_line.error_poison_system_directories = true; |
266 | + break; | 266 | + break; |
267 | + | 267 | + |
268 | case OPTION_DEPENDENCY_FILE: | 268 | case OPTION_DEPENDENCY_FILE: |