/* MIPS-specific support for 64-bit ELF
- Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2024 Free Software Foundation, Inc.
Ian Lance Taylor, Cygnus Support
Linker support added by Mark Mitchell, CodeSourcery, LLC.
<mark@codesourcery.com>
/* High 16 bits of displacement in global offset table. */
HOWTO (R_MIPS_GOT_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* High 16 bits of displacement in global offset table. */
HOWTO (R_MIPS_CALL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* TLS local dynamic offset. */
HOWTO (R_MIPS_TLS_DTPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_DTPREL_LO16", /* name */
true, /* partial_inplace */
/* TLS thread pointer offset. */
HOWTO (R_MIPS_TLS_TPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_TPREL_LO16", /* name */
true, /* partial_inplace */
/* High 16 bits of symbol value. */
HOWTO (R_MIPS_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* High 16 bits of displacement in global offset table. */
HOWTO (R_MIPS_GOT_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* Get the higher value of a 64 bit addend. */
HOWTO (R_MIPS_HIGHER, /* type */
- 0, /* rightshift */
+ 32, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* Get the highest value of a 64 bit addend. */
HOWTO (R_MIPS_HIGHEST, /* type */
- 0, /* rightshift */
+ 48, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* High 16 bits of displacement in global offset table. */
HOWTO (R_MIPS_CALL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* TLS local dynamic offset. */
HOWTO (R_MIPS_TLS_DTPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_DTPREL_LO16", /* name */
false, /* partial_inplace */
/* TLS thread pointer offset. */
HOWTO (R_MIPS_TLS_TPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_TLS_TPREL_LO16", /* name */
false, /* partial_inplace */
/* MIPS16 TLS local dynamic offset. */
HOWTO (R_MIPS16_TLS_DTPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_DTPREL_LO16", /* name */
true, /* partial_inplace */
/* MIPS16 TLS thread pointer offset. */
HOWTO (R_MIPS16_TLS_TPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_TPREL_LO16", /* name */
true, /* partial_inplace */
/* MIPS16 TLS local dynamic offset. */
HOWTO (R_MIPS16_TLS_DTPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_DTPREL_LO16", /* name */
false, /* partial_inplace */
/* MIPS16 TLS thread pointer offset. */
HOWTO (R_MIPS16_TLS_TPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_TLS_TPREL_LO16", /* name */
false, /* partial_inplace */
/* High 16 bits of displacement in global offset table. */
HOWTO (R_MICROMIPS_GOT_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* High 16 bits of displacement in global offset table. */
HOWTO (R_MICROMIPS_CALL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* TLS local dynamic offset. */
HOWTO (R_MICROMIPS_TLS_DTPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MICROMIPS_TLS_DTPREL_LO16", /* name */
true, /* partial_inplace */
/* TLS thread pointer offset. */
HOWTO (R_MICROMIPS_TLS_TPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MICROMIPS_TLS_TPREL_LO16", /* name */
true, /* partial_inplace */
/* High 16 bits of displacement in global offset table. */
HOWTO (R_MICROMIPS_GOT_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* Get the higher value of a 64 bit addend. */
HOWTO (R_MICROMIPS_HIGHER, /* type */
- 0, /* rightshift */
+ 32, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* Get the highest value of a 64 bit addend. */
HOWTO (R_MICROMIPS_HIGHEST, /* type */
- 0, /* rightshift */
+ 48, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* High 16 bits of displacement in global offset table. */
HOWTO (R_MICROMIPS_CALL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
/* TLS local dynamic offset. */
HOWTO (R_MICROMIPS_TLS_DTPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MICROMIPS_TLS_DTPREL_LO16", /* name */
false, /* partial_inplace */
/* TLS thread pointer offset. */
HOWTO (R_MICROMIPS_TLS_TPREL_HI16, /* type */
- 0, /* rightshift */
+ 16, /* rightshift */
4, /* size */
16, /* bitsize */
false, /* pc_relative */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MICROMIPS_TLS_TPREL_LO16", /* name */
false, /* partial_inplace */
else
relocation = symbol->value;
- relocation += symbol->section->output_section->vma;
- relocation += symbol->section->output_offset;
+ if (symbol->section->output_section != NULL)
+ {
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ }
if (!_bfd_mips_reloc_offset_in_range (abfd, input_section, reloc_entry,
check_inplace))
#define elf_backend_get_target_dtag _bfd_mips_elf_get_target_dtag
#define elf_backend_adjust_dynamic_symbol \
_bfd_mips_elf_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- _bfd_mips_elf_always_size_sections
-#define elf_backend_size_dynamic_sections \
- _bfd_mips_elf_size_dynamic_sections
+#define elf_backend_late_size_sections \
+ _bfd_mips_elf_late_size_sections
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_relocate_section _bfd_mips_elf_relocate_section
#define elf_backend_finish_dynamic_symbol \
#define bfd_elf64_get_dynamic_reloc_upper_bound mips_elf64_get_dynamic_reloc_upper_bound
#define bfd_elf64_mkobject _bfd_mips_elf_mkobject
+#define bfd_elf64_bfd_free_cached_info _bfd_mips_elf_free_cached_info
/* The SGI style (n)64 NewABI. */
#define TARGET_LITTLE_SYM mips_elf64_le_vec