Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(996)

Unified Diff: bfd/elf32-mips.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bfd/elf32-microblaze.c ('k') | bfd/elf32-moxie.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bfd/elf32-mips.c
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 61e8b454ff00aeebe06e8301a19533e17da79fe1..eec2ef7f053f731bad13ee802aa287a9fe3df989 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -1515,7 +1515,7 @@ static reloc_howto_type elf_mips_copy_howto =
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ _bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_COPY", /* name */
FALSE, /* partial_inplace */
0x0, /* src_mask */
@@ -1531,13 +1531,29 @@ static reloc_howto_type elf_mips_jump_slot_howto =
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ _bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_JUMP_SLOT", /* name */
FALSE, /* partial_inplace */
0x0, /* src_mask */
0x0, /* dst_mask */
FALSE); /* pcrel_offset */
+/* Used in EH tables. */
+static reloc_howto_type elf_mips_eh_howto =
+ HOWTO (R_MIPS_EH, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ _bfd_mips_elf_generic_reloc, /* special_function */
+ "R_MIPS_EH", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE); /* pcrel_offset */
+
/* Set the GP value for OUTPUT_BFD. Returns FALSE if this is a
dangerous relocation. */
@@ -2010,6 +2026,8 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
return &elf_mips_copy_howto;
case BFD_RELOC_MIPS_JUMP_SLOT:
return &elf_mips_jump_slot_howto;
+ case BFD_RELOC_MIPS_EH:
+ return &elf_mips_eh_howto;
}
}
@@ -2055,6 +2073,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
return &elf_mips_copy_howto;
if (strcasecmp (elf_mips_jump_slot_howto.name, r_name) == 0)
return &elf_mips_jump_slot_howto;
+ if (strcasecmp (elf_mips_eh_howto.name, r_name) == 0)
+ return &elf_mips_eh_howto;
return NULL;
}
@@ -2079,6 +2099,8 @@ mips_elf32_rtype_to_howto (unsigned int r_type,
return &elf_mips_copy_howto;
case R_MIPS_JUMP_SLOT:
return &elf_mips_jump_slot_howto;
+ case R_MIPS_EH:
+ return &elf_mips_eh_howto;
default:
if (r_type >= R_MICROMIPS_min && r_type < R_MICROMIPS_max)
return &elf_micromips_howto_table_rel[r_type - R_MICROMIPS_min];
@@ -2145,18 +2167,17 @@ mips_elf32_object_p (bfd *abfd)
{
unsigned long mach;
+ if (ABI_N32_P (abfd))
+ return FALSE;
+
/* Irix 5 and 6 are 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. */
if (SGI_COMPAT (abfd))
elf_bad_symtab (abfd) = TRUE;
- if (ABI_N32_P (abfd))
- return FALSE;
-
mach = _bfd_elf_mips_mach (elf_elfheader (abfd)->e_flags);
bfd_default_set_arch_mach (abfd, bfd_arch_mips, mach);
-
return TRUE;
}
@@ -2187,10 +2208,10 @@ elf32_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
case 256: /* Linux/MIPS */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
@@ -2213,9 +2234,9 @@ elf32_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
return FALSE;
case 128: /* Linux/MIPS elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
}
@@ -2224,7 +2245,7 @@ elf32_mips_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
@@ -2345,7 +2366,6 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#define elf_backend_default_use_rela_p 0
#define elf_backend_sign_extend_vma TRUE
#define elf_backend_plt_readonly 1
-#define elf_backend_plt_sym_val _bfd_mips_elf_plt_sym_val
#define elf_backend_discard_info _bfd_mips_elf_discard_info
#define elf_backend_ignore_discarded_relocs \
@@ -2357,6 +2377,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
mips_elf_is_local_label_name
#define bfd_elf32_bfd_is_target_special_symbol \
_bfd_mips_elf_is_target_special_symbol
+#define bfd_elf32_get_synthetic_symtab _bfd_mips_elf_get_synthetic_symtab
#define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line
#define bfd_elf32_find_inliner_info _bfd_mips_elf_find_inliner_info
#define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook
@@ -2372,6 +2393,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#define bfd_elf32_bfd_print_private_bfd_data \
_bfd_mips_elf_print_private_bfd_data
#define bfd_elf32_bfd_relax_section _bfd_mips_elf_relax_section
+#define bfd_elf32_mkobject _bfd_mips_elf_mkobject
/* Support for SGI-ish mips targets. */
#define TARGET_LITTLE_SYM bfd_elf32_littlemips_vec
@@ -2464,6 +2486,7 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
#define TARGET_LITTLE_NAME "elf32-littlemips-vxworks"
#define TARGET_BIG_SYM bfd_elf32_bigmips_vxworks_vec
#define TARGET_BIG_NAME "elf32-bigmips-vxworks"
+#undef ELF_OSABI
#undef elf32_bed
#define elf32_bed elf32_mips_vxworks_bed
@@ -2483,7 +2506,6 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
#define elf_backend_default_use_rela_p 1
#undef elf_backend_got_header_size
#define elf_backend_got_header_size (4 * 3)
-#undef elf_backend_plt_sym_val
#undef elf_backend_finish_dynamic_symbol
#define elf_backend_finish_dynamic_symbol \
@@ -2509,4 +2531,6 @@ mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
#undef elf_backend_symbol_processing
/* NOTE: elf_backend_rela_normal is not defined for MIPS. */
+#undef bfd_elf32_get_synthetic_symtab
+
#include "elf32-target.h"
« no previous file with comments | « bfd/elf32-microblaze.c ('k') | bfd/elf32-moxie.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698