summaryrefslogtreecommitdiff
path: root/bfd/elf-nacl.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2012-11-26 17:49:11 +0000
committerRoland McGrath <roland@gnu.org>2012-11-26 17:49:11 +0000
commit9431906922813761e2bef0c912612ce99d2988ca (patch)
tree478ce7ed1b68eabbea4e1ff807ebdcac0f0b0e38 /bfd/elf-nacl.c
parent60271f62d0852e829c89a4d021b0edf5c139b33e (diff)
downloadbinutils-redhat-9431906922813761e2bef0c912612ce99d2988ca.tar.gz
bfd/
* elf-nacl.c (nacl_modify_segment_map): Don't crash when INFO is null.
Diffstat (limited to 'bfd/elf-nacl.c')
-rw-r--r--bfd/elf-nacl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bfd/elf-nacl.c b/bfd/elf-nacl.c
index 04659e7fb1..ce401fae3c 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;