summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/0006-warn-for-uses-of-system-directories-when-cross-linki.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/0006-warn-for-uses-of-system-directories-when-cross-linki.patch')
-rw-r--r--meta/recipes-devtools/binutils/binutils/0006-warn-for-uses-of-system-directories-when-cross-linki.patch59
1 files changed, 29 insertions, 30 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/0006-warn-for-uses-of-system-directories-when-cross-linki.patch b/meta/recipes-devtools/binutils/binutils/0006-warn-for-uses-of-system-directories-when-cross-linki.patch
index 87bbe9fb1b..9b09ec09cb 100644
--- a/meta/recipes-devtools/binutils/binutils/0006-warn-for-uses-of-system-directories-when-cross-linki.patch
+++ b/meta/recipes-devtools/binutils/binutils/0006-warn-for-uses-of-system-directories-when-cross-linki.patch
@@ -1,4 +1,4 @@
1From 725ca09ee1041f64589f26ba815ef11da687c608 Mon Sep 17 00:00:00 2001 1From 41b09c6a9d78a31db0f3c70d27c05475292bde7e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 15 Jan 2016 06:31:09 +0000 3Date: Fri, 15 Jan 2016 06:31:09 +0000
4Subject: [PATCH] warn for uses of system directories when cross linking 4Subject: [PATCH] warn for uses of system directories when cross linking
@@ -59,8 +59,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
59 ld/ldfile.c | 17 +++++++++++++++++ 59 ld/ldfile.c | 17 +++++++++++++++++
60 ld/ldlex.h | 2 ++ 60 ld/ldlex.h | 2 ++
61 ld/ldmain.c | 6 ++++-- 61 ld/ldmain.c | 6 ++++--
62 ld/lexsup.c | 16 ++++++++++++++++ 62 ld/lexsup.c | 15 +++++++++++++++
63 9 files changed, 88 insertions(+), 2 deletions(-) 63 9 files changed, 87 insertions(+), 2 deletions(-)
64 64
65diff --git a/ld/config.in b/ld/config.in 65diff --git a/ld/config.in b/ld/config.in
66index ad0dc6a106c..d21edaddce7 100644 66index ad0dc6a106c..d21edaddce7 100644
@@ -77,7 +77,7 @@ index ad0dc6a106c..d21edaddce7 100644
77 #undef EXTRA_SHLIB_EXTENSION 77 #undef EXTRA_SHLIB_EXTENSION
78 78
79diff --git a/ld/configure b/ld/configure 79diff --git a/ld/configure b/ld/configure
80index 995708089fd..6406a42c442 100755 80index 1503936432f..29896853a90 100755
81--- a/ld/configure 81--- a/ld/configure
82+++ b/ld/configure 82+++ b/ld/configure
83@@ -839,6 +839,7 @@ with_lib_path 83@@ -839,6 +839,7 @@ with_lib_path
@@ -139,7 +139,7 @@ index 77edac3258c..a74dac63038 100644
139 dnl "install_as_default" is set to false if gold is the default linker. 139 dnl "install_as_default" is set to false if gold is the default linker.
140 dnl "installed_linker" is the installed BFD linker name. 140 dnl "installed_linker" is the installed BFD linker name.
141diff --git a/ld/ld.h b/ld/ld.h 141diff --git a/ld/ld.h b/ld/ld.h
142index 05649ff61b8..1818c227473 100644 142index a0f8a15c7a9..e3db345f3a5 100644
143--- a/ld/ld.h 143--- a/ld/ld.h
144+++ b/ld/ld.h 144+++ b/ld/ld.h
145@@ -163,6 +163,14 @@ typedef struct 145@@ -163,6 +163,14 @@ typedef struct
@@ -158,10 +158,10 @@ index 05649ff61b8..1818c227473 100644
158 enum endian_enum endian; 158 enum endian_enum endian;
159 159
160diff --git a/ld/ld.texi b/ld/ld.texi 160diff --git a/ld/ld.texi b/ld/ld.texi
161index db3a9f09b45..77037399cb9 100644 161index aa8b1aa86eb..9bc4bc28823 100644
162--- a/ld/ld.texi 162--- a/ld/ld.texi
163+++ b/ld/ld.texi 163+++ b/ld/ld.texi
164@@ -2960,6 +2960,18 @@ creation of the metadata note, if one had been enabled by an earlier 164@@ -3059,6 +3059,18 @@ creation of the metadata note, if one had been enabled by an earlier
165 occurrence of the --package-metdata option. 165 occurrence of the --package-metdata option.
166 If the linker has been built with libjansson, then the JSON string 166 If the linker has been built with libjansson, then the JSON string
167 will be validated. 167 will be validated.
@@ -181,10 +181,10 @@ index db3a9f09b45..77037399cb9 100644
181 181
182 @c man end 182 @c man end
183diff --git a/ld/ldfile.c b/ld/ldfile.c 183diff --git a/ld/ldfile.c b/ld/ldfile.c
184index b8fd4e5d8e0..1f1d8e23bc9 100644 184index df7c9cbd65e..0c965593225 100644
185--- a/ld/ldfile.c 185--- a/ld/ldfile.c
186+++ b/ld/ldfile.c 186+++ b/ld/ldfile.c
187@@ -117,6 +117,23 @@ ldfile_add_library_path (const char *name, bool cmdline) 187@@ -327,6 +327,23 @@ ldfile_add_library_path (const char *name, bool cmdline)
188 new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL); 188 new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL);
189 else 189 else
190 new_dirs->name = xstrdup (name); 190 new_dirs->name = xstrdup (name);
@@ -209,23 +209,23 @@ index b8fd4e5d8e0..1f1d8e23bc9 100644
209 209
210 /* Try to open a BFD for a lang_input_statement. */ 210 /* Try to open a BFD for a lang_input_statement. */
211diff --git a/ld/ldlex.h b/ld/ldlex.h 211diff --git a/ld/ldlex.h b/ld/ldlex.h
212index 0538f0a06a1..f94a71875d8 100644 212index 87cac02141d..d1a478fb827 100644
213--- a/ld/ldlex.h 213--- a/ld/ldlex.h
214+++ b/ld/ldlex.h 214+++ b/ld/ldlex.h
215@@ -170,6 +170,8 @@ enum option_values 215@@ -147,6 +147,8 @@ enum option_values
216 OPTION_NO_WARN_EXECSTACK, 216 OPTION_PLUGIN,
217 OPTION_WARN_RWX_SEGMENTS, 217 OPTION_PLUGIN_OPT,
218 OPTION_NO_WARN_RWX_SEGMENTS, 218 #endif /* BFD_SUPPORTS_PLUGINS */
219+ OPTION_NO_POISON_SYSTEM_DIRECTORIES, 219+ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
220+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES, 220+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
221 }; 221 OPTION_DEFAULT_SCRIPT,
222 222 OPTION_PRINT_OUTPUT_FORMAT,
223 /* The initial parser states. */ 223 OPTION_PRINT_SYSROOT,
224diff --git a/ld/ldmain.c b/ld/ldmain.c 224diff --git a/ld/ldmain.c b/ld/ldmain.c
225index ceaca2d85d0..62e7b4e5341 100644 225index 5c38e8cd313..04eed320aca 100644
226--- a/ld/ldmain.c 226--- a/ld/ldmain.c
227+++ b/ld/ldmain.c 227+++ b/ld/ldmain.c
228@@ -322,6 +322,8 @@ main (int argc, char **argv) 228@@ -326,6 +326,8 @@ main (int argc, char **argv)
229 command_line.warn_mismatch = true; 229 command_line.warn_mismatch = true;
230 command_line.warn_search_mismatch = true; 230 command_line.warn_search_mismatch = true;
231 command_line.check_section_addresses = -1; 231 command_line.check_section_addresses = -1;
@@ -234,7 +234,7 @@ index ceaca2d85d0..62e7b4e5341 100644
234 234
235 /* We initialize DEMANGLING based on the environment variable 235 /* We initialize DEMANGLING based on the environment variable
236 COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the 236 COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
237@@ -1454,7 +1456,7 @@ undefined_symbol (struct bfd_link_info *info, 237@@ -1458,7 +1460,7 @@ undefined_symbol (struct bfd_link_info *info,
238 argv[1] = "undefined-symbol"; 238 argv[1] = "undefined-symbol";
239 argv[2] = (char *) name; 239 argv[2] = (char *) name;
240 argv[3] = NULL; 240 argv[3] = NULL;
@@ -243,7 +243,7 @@ index ceaca2d85d0..62e7b4e5341 100644
243 if (verbose) 243 if (verbose)
244 einfo (_("%P: About to run error handling script '%s' with arguments: '%s' '%s'\n"), 244 einfo (_("%P: About to run error handling script '%s' with arguments: '%s' '%s'\n"),
245 argv[0], argv[1], argv[2]); 245 argv[0], argv[1], argv[2]);
246@@ -1475,7 +1477,7 @@ undefined_symbol (struct bfd_link_info *info, 246@@ -1479,7 +1481,7 @@ undefined_symbol (struct bfd_link_info *info,
247 carry on to issue the normal error message. */ 247 carry on to issue the normal error message. */
248 } 248 }
249 #endif /* SUPPORT_ERROR_HANDLING_SCRIPT */ 249 #endif /* SUPPORT_ERROR_HANDLING_SCRIPT */
@@ -253,10 +253,10 @@ index ceaca2d85d0..62e7b4e5341 100644
253 { 253 {
254 if (error_count < MAX_ERRORS_IN_A_ROW) 254 if (error_count < MAX_ERRORS_IN_A_ROW)
255diff --git a/ld/lexsup.c b/ld/lexsup.c 255diff --git a/ld/lexsup.c b/ld/lexsup.c
256index a1c6140100d..d47ba4f977d 100644 256index fe8722313fe..1df7af3ccaa 100644
257--- a/ld/lexsup.c 257--- a/ld/lexsup.c
258+++ b/ld/lexsup.c 258+++ b/ld/lexsup.c
259@@ -613,6 +613,14 @@ static const struct ld_option ld_options[] = 259@@ -629,6 +629,14 @@ static const struct ld_option ld_options[] =
260 " <method> is: share-unconflicted (default),\n" 260 " <method> is: share-unconflicted (default),\n"
261 " share-duplicated"), 261 " share-duplicated"),
262 TWO_DASHES }, 262 TWO_DASHES },
@@ -271,18 +271,17 @@ index a1c6140100d..d47ba4f977d 100644
271 }; 271 };
272 272
273 #define OPTION_COUNT ARRAY_SIZE (ld_options) 273 #define OPTION_COUNT ARRAY_SIZE (ld_options)
274@@ -1737,6 +1745,14 @@ parse_args (unsigned argc, char **argv) 274@@ -1787,6 +1795,13 @@ parse_args (unsigned argc, char **argv)
275 config.print_map_discarded = true;
276 break;
277 275
276 case OPTION_PRINT_MAP_LOCALS:
277 config.print_map_locals = true;
278+
278+ case OPTION_NO_POISON_SYSTEM_DIRECTORIES: 279+ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
279+ command_line.poison_system_directories = false; 280+ command_line.poison_system_directories = false;
280+ break; 281+ break;
281+ 282+
282+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES: 283+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
283+ command_line.error_poison_system_directories = true; 284+ command_line.error_poison_system_directories = true;
284+ break;
285+
286 case OPTION_DEPENDENCY_FILE:
287 config.dependency_file = optarg;
288 break; 285 break;
286
287 case OPTION_DEPENDENCY_FILE: