You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
static void mips_elf_symbol_processing PARAMS ((bfd *, asymbol *));
static boolean mips_elf_read_ecoff_info
PARAMS ((bfd *, asection *, struct ecoff_debug_info *));
+static boolean mips_elf_is_local_label
+ PARAMS ((bfd *, asymbol *));
static boolean mips_elf_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *));
}
}
- return gprel16_with_gp (symbol, reloc_entry, input_section, relocateable,
- data, elf_gp (output_bfd));
+ return gprel16_with_gp (abfd, symbol, reloc_entry, input_section,
+ relocateable, data, elf_gp (output_bfd));
}
static bfd_reloc_status_type
/* Irix 5 is broken. Object file symbol tables are not always
sorted correctly such that local symbols precede global symbols,
- and the sh_info field in the symbol table is not always right.
- We try to quickly check whether the symbol table is broken for
- this BFD, and, if it is, we set elf_bad_symtab in tdata. */
- if (elf_onesymtab (abfd) != 0)
- {
- Elf_Internal_Shdr *symtab_hdr;
- Elf32_External_Sym esym;
-
- symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
- if (bfd_seek (abfd,
- (symtab_hdr->sh_offset
- + symtab_hdr->sh_size
- - sizeof (Elf32_External_Sym)),
- SEEK_SET) != 0
- || (bfd_read ((PTR) &esym, 1, sizeof (Elf32_External_Sym), abfd)
- != sizeof (Elf32_External_Sym)))
- return false;
- if (ELF_ST_BIND (bfd_h_get_8 (abfd, (bfd_byte *) esym.st_info))
- == STB_LOCAL)
- elf_bad_symtab (abfd) = true;
- }
+ and the sh_info field in the symbol table is not always right. */
+ elf_bad_symtab (abfd) = true;
return true;
}
swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
- ext_hdr = (char *) malloc (swap->external_hdr_size);
+ ext_hdr = (char *) malloc ((size_t) swap->external_hdr_size);
if (ext_hdr == NULL && swap->external_hdr_size != 0)
{
bfd_set_error (bfd_error_no_memory);
debug->ptr = NULL; \
else \
{ \
- debug->ptr = (type) malloc (size * symhdr->count); \
+ debug->ptr = (type) malloc ((size_t) (size * symhdr->count)); \
if (debug->ptr == NULL) \
{ \
bfd_set_error (bfd_error_no_memory); \
return false;
}
\f
+/* MIPS ELF local labels start with '$', not 'L'. */
+
+/*ARGSUSED*/
+static boolean
+mips_elf_is_local_label (abfd, symbol)
+ bfd *abfd;
+ asymbol *symbol;
+{
+ return symbol->name[0] == '$';
+}
+
/* MIPS ELF uses a special find_nearest_line routine in order the
handle the ECOFF debugging information. */
/* Fall back on the generic ELF find_nearest_line routine. */
- return bfd_elf32_find_nearest_line (abfd, section, symbols, offset,
- filename_ptr, functionname_ptr,
- line_ptr);
+ return _bfd_elf_find_nearest_line (abfd, section, symbols, offset,
+ filename_ptr, functionname_ptr,
+ line_ptr);
}
\f
/* The MIPS ELF linker needs additional information for each symbol in
name = h->root.root.string;
else
{
- name = elf_string_from_elf_section (input_bfd,
- symtab_hdr->sh_link,
- sym->st_name);
+ name = bfd_elf_string_from_elf_section (input_bfd,
+ symtab_hdr->sh_link,
+ sym->st_name);
if (name == NULL)
return false;
if (*name == '\0')
arelent **parent;
/* for mips */
int gp_found;
- bfd_vma gp;
+ bfd_vma gp = 0x12345678; /* initialize just to shut gcc up */
{
struct bfd_hash_entry *h;
lh = 0;
else
{
- h = bfd_hash_lookup (link_info->hash, "_gp", false, false);
+ h = bfd_hash_lookup (&link_info->hash->table, "_gp", false, false);
lh = (struct bfd_link_hash_entry *) h;
}
lookup:
mips_elf_final_write_processing
#define elf_backend_ecoff_debug_swap &mips_elf_ecoff_debug_swap
+#define bfd_elf32_bfd_is_local_label mips_elf_is_local_label
#define bfd_elf32_find_nearest_line mips_elf_find_nearest_line
#define bfd_elf32_bfd_link_hash_table_create \