link, we remove such relocations. Otherwise, we just want the
section contents zeroed and avoid any special processing. */
#define RELOC_AGAINST_DISCARDED_SECTION(info, input_bfd, input_section, \
- rel, count, relend, \
+ rel, count, relend, rnone, \
howto, index, contents) \
{ \
- int i_; \
_bfd_clear_contents (howto, input_bfd, input_section, \
contents, rel[index].r_offset); \
\
} \
} \
\
- for (i_ = 0; i_ < count; i_++) \
+ for (int i_ = 0; i_ < count; i_++) \
{ \
- rel[i_].r_info = 0; \
+ rel[i_].r_info = rnone; \
rel[i_].r_addend = 0; \
} \
rel += count - 1; \
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_MN10200_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_MN10300_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_ARM_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_AVR_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_BFIN_UNUSED0,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_BFIN_UNUSED0,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_CR16_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_CRIS_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_CRX_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
else
#endif
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0,
- contents);
+ rel, 1, relend, R_CKCORE_NONE,
+ howto, 0, contents);
}
if (bfd_link_relocatable (info))
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_D10V_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_EPIPHANY_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_FR30_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_FRV_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_FT32_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_H8_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sym_sec != NULL && discarded_section (sym_sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rela, 1, relend,
+ rela, 1, relend, R_PARISC_NONE,
elf_hppa_howto_table + r_type, 0,
contents);
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_IP2K_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_IQ2000_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_LM32_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_M32C_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_M32R_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info) && !use_rel)
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_M68HC11_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_68K_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_MCORE_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_MEP_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
return r;
}
-/* This is defined because R_METAG_NONE != 0...
- See RELOC_AGAINST_DISCARDED_SECTION for details. */
-#define METAG_RELOC_AGAINST_DISCARDED_SECTION(info, input_bfd, input_section, \
- rel, relend, howto, contents) \
- { \
- _bfd_clear_contents (howto, input_bfd, input_section, \
- contents, rel->r_offset); \
- \
- if (bfd_link_relocatable (info) \
- && (input_section->flags & SEC_DEBUGGING)) \
- { \
- /* Only remove relocations in debug sections since other \
- sections may require relocations. */ \
- Elf_Internal_Shdr *rel_hdr; \
- \
- rel_hdr = _bfd_elf_single_rel_hdr (input_section->output_section); \
- \
- /* Avoid empty output section. */ \
- if (rel_hdr->sh_size > rel_hdr->sh_entsize) \
- { \
- rel_hdr->sh_size -= rel_hdr->sh_entsize; \
- rel_hdr = _bfd_elf_single_rel_hdr (input_section); \
- rel_hdr->sh_size -= rel_hdr->sh_entsize; \
- \
- memmove (rel, rel + 1, (relend - rel) * sizeof (*rel)); \
- \
- input_section->reloc_count--; \
- relend--; \
- rel--; \
- continue; \
- } \
- } \
- \
- rel->r_info = R_METAG_NONE; \
- rel->r_addend = 0; \
- continue; \
- }
-
/* Relocate a META ELF section.
The RELOCATE_SECTION function is called by the new ELF backend linker
}
if (sec != NULL && discarded_section (sec))
- METAG_RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, relend, howto, contents);
+ RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
+ rel, 1, relend, R_METAG_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_MOXIE_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_MSP430_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_MT_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_OR1K_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_PRU_NONE,
+ howto, 0, contents);
/* Nothing more to do unless this is a final link. */
if (bfd_link_relocatable (info))
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_RL78_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_RX_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_390_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_SCORE_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_SCORE_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_SH_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_SPU_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_C6000_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_TILEPRO_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_V850_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_VAX_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_XSTORMY16_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_XTENSA_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
reloc_howto_type *howto;
howto = z80_rtype_to_howto (input_bfd, r_type);
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_Z80_NONE,
+ howto, 0, contents);
}
if (bfd_link_relocatable (info))
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend,
+ rel, 1, relend, R_ALPHA_NONE,
elf64_alpha_howto_table + r_type, 0,
contents);
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_ALPHA_NONE,
+ howto, 0, contents);
addend = rel->r_addend;
value += addend;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_BPF_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sym_sec != NULL && discarded_section (sym_sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_PARISC_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
section contents zeroed. Avoid any special processing. */
if (sym_sec != NULL && discarded_section (sym_sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_IA64_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_MMIX_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
{
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_390_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_AARCH64_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sym_sec != NULL && discarded_section (sym_sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_IA64_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_KVX_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
name = loongarch_sym_name (input_bfd, h, sym);
if (sec != NULL && discarded_section (sec))
- RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, rel,
- 1, relend, howto, 0, contents);
+ RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
+ rel, 1, relend, R_LARCH_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_RISCV_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
do
{
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- (*rel), count, (*relend),
+ (*rel), count, (*relend), R_MIPS_NONE,
howto, i, contents);
}
while (0);
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_SPARC_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ rel, 1, relend, R_TILEGX_NONE,
+ howto, 0, contents);
if (bfd_link_relocatable (info))
continue;