mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-29 16:38:05 +08:00
* elf32-sh.c (sh_elf_osec_to_segment): Check for elf flavour bfd
before calling elf specific function. (sh_elf_osec_readonly_p): Test for error return from above.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2012-02-27 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* elf32-sh.c (sh_elf_osec_to_segment): Check for elf flavour bfd
|
||||||
|
before calling elf specific function.
|
||||||
|
(sh_elf_osec_readonly_p): Test for error return from above.
|
||||||
|
|
||||||
2012-02-27 Alan Modra <amodra@gmail.com>
|
2012-02-27 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elf32-spu.c (build_stub): Fix malloc under-allocation.
|
* elf32-spu.c (build_stub): Fix malloc under-allocation.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* Renesas / SuperH SH specific support for 32-bit ELF
|
/* Renesas / SuperH SH specific support for 32-bit ELF
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||||
2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
2006, 2007, 2008, 2009, 2010, 2011, 2012
|
||||||
|
Free Software Foundation, Inc.
|
||||||
Contributed by Ian Lance Taylor, Cygnus Support.
|
Contributed by Ian Lance Taylor, Cygnus Support.
|
||||||
|
|
||||||
This file is part of BFD, the Binary File Descriptor library.
|
This file is part of BFD, the Binary File Descriptor library.
|
||||||
@ -3788,8 +3789,10 @@ sh_elf_got_offset (struct elf_sh_link_hash_table *htab)
|
|||||||
static unsigned
|
static unsigned
|
||||||
sh_elf_osec_to_segment (bfd *output_bfd, asection *osec)
|
sh_elf_osec_to_segment (bfd *output_bfd, asection *osec)
|
||||||
{
|
{
|
||||||
Elf_Internal_Phdr *p = _bfd_elf_find_segment_containing_section (output_bfd,
|
Elf_Internal_Phdr *p = NULL;
|
||||||
osec);
|
|
||||||
|
if (output_bfd->xvec->flavour == bfd_target_elf_flavour)
|
||||||
|
p = _bfd_elf_find_segment_containing_section (output_bfd, osec);
|
||||||
|
|
||||||
/* FIXME: Nothing ever says what this index is relative to. The kernel
|
/* FIXME: Nothing ever says what this index is relative to. The kernel
|
||||||
supplies data in terms of the number of load segments but this is
|
supplies data in terms of the number of load segments but this is
|
||||||
@ -3802,7 +3805,8 @@ sh_elf_osec_readonly_p (bfd *output_bfd, asection *osec)
|
|||||||
{
|
{
|
||||||
unsigned seg = sh_elf_osec_to_segment (output_bfd, osec);
|
unsigned seg = sh_elf_osec_to_segment (output_bfd, osec);
|
||||||
|
|
||||||
return ! (elf_tdata (output_bfd)->phdr[seg].p_flags & PF_W);
|
return (seg != (unsigned) -1
|
||||||
|
&& ! (elf_tdata (output_bfd)->phdr[seg].p_flags & PF_W));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate the initial contents of a local function descriptor, along
|
/* Generate the initial contents of a local function descriptor, along
|
||||||
|
Reference in New Issue
Block a user