summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils-2.23.1/backport/0024-bfd.patch
blob: f50c2ec075d2d061e5098a452d606dba0ccb58df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From f9fd8f72b070bfdc49c957f3968e6fcec34b57fc Mon Sep 17 00:00:00 2001
From: Roland McGrath <roland@gnu.org>
Date: Mon, 26 Nov 2012 17:50:04 +0000
Subject: [PATCH 24/27] bfd/ 	* elf-nacl.c (nacl_modify_segment_map): Don't
 crash when INFO is null.

---
 bfd/ChangeLog  |    4 ++++
 bfd/elf-nacl.c |    5 ++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index cf65838..5500b36 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2012-11-26  Roland McGrath  <mcgrathr@google.com>
+
+	* elf-nacl.c (nacl_modify_segment_map): Don't crash when INFO is null.
+
 2012-11-21  Roland McGrath  <mcgrathr@google.com>
 
 	* elf-nacl.c (segment_nonexecutable_and_has_contents): Renamed to ...
diff --git a/bfd/elf-nacl.c b/bfd/elf-nacl.c
index 04659e7..ce401fa 100644
--- a/bfd/elf-nacl.c
+++ b/bfd/elf-nacl.c
@@ -75,7 +75,7 @@ nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
   struct elf_segment_map **first_load = NULL;
   struct elf_segment_map **last_load = NULL;
   bfd_boolean moved_headers = FALSE;
-  int sizeof_headers = bfd_sizeof_headers (abfd, info);
+  int sizeof_headers = info == NULL ? 0 : bfd_sizeof_headers (abfd, info);
   bfd_vma maxpagesize = get_elf_backend_data (abfd)->maxpagesize;
 
   if (info != NULL && info->user_phdrs)
@@ -149,8 +149,7 @@ nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
    proper order for the ELF rule that they must appear in ascending address
    order.  So find the two segments we swapped before, and swap them back.  */
 bfd_boolean
-nacl_modify_program_headers (bfd *abfd,
-                             struct bfd_link_info *info ATTRIBUTE_UNUSED)
+nacl_modify_program_headers (bfd *abfd, struct bfd_link_info *info)
 {
   struct elf_segment_map **m = &elf_tdata (abfd)->segment_map;
   Elf_Internal_Phdr *phdr = elf_tdata (abfd)->phdr;
-- 
1.7.9.5