projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RISC-V: Allow nested implications for extensions
[binutils-gdb.git]
/
bfd
/
elf32-fr30.c
diff --git
a/bfd/elf32-fr30.c
b/bfd/elf32-fr30.c
index 1ef9dedc69c9266e37f14831db8c83d1f9533b5c..37d3e0f659b6694d67683a49496ebe447a4cb95c 100644
(file)
--- a/
bfd/elf32-fr30.c
+++ b/
bfd/elf32-fr30.c
@@
-1,5
+1,5
@@
/* FR30-specific support for 32-bit ELF.
/* FR30-specific support for 32-bit ELF.
- Copyright (C) 1998-20
18
Free Software Foundation, Inc.
+ Copyright (C) 1998-20
23
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This file is part of BFD, the Binary File Descriptor library.
@@
-37,196
+37,196
@@
static reloc_howto_type fr30_elf_howto_table [] =
/* This reloc does nothing. */
HOWTO (R_FR30_NONE, /* type */
0, /* rightshift */
/* This reloc does nothing. */
HOWTO (R_FR30_NONE, /* type */
0, /* rightshift */
-
3, /* size (0 = byte, 1 = short, 2 = long)
*/
+
0, /* size
*/
0, /* bitsize */
0, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_NONE", /* name */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_NONE", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
0, /* src_mask */
0, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* An 8 bit absolute relocation. */
HOWTO (R_FR30_8, /* type */
0, /* rightshift */
/* An 8 bit absolute relocation. */
HOWTO (R_FR30_8, /* type */
0, /* rightshift */
-
1, /* size (0 = byte, 1 = short, 2 = long)
*/
+
2, /* size
*/
8, /* bitsize */
8, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
4, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_8", /* name */
4, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_8", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* A 20 bit absolute relocation. */
HOWTO (R_FR30_20, /* type */
0, /* rightshift */
/* A 20 bit absolute relocation. */
HOWTO (R_FR30_20, /* type */
0, /* rightshift */
-
2, /* size (0 = byte, 1 = short, 2 = long)
*/
+
4, /* size
*/
20, /* bitsize */
20, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
fr30_elf_i20_reloc, /* special_function */
"R_FR30_20", /* name */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
fr30_elf_i20_reloc, /* special_function */
"R_FR30_20", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x00000000, /* src_mask */
0x00f0ffff, /* dst_mask */
0x00000000, /* src_mask */
0x00f0ffff, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* A 32 bit absolute relocation. */
HOWTO (R_FR30_32, /* type */
0, /* rightshift */
/* A 32 bit absolute relocation. */
HOWTO (R_FR30_32, /* type */
0, /* rightshift */
-
2, /* size (0 = byte, 1 = short, 2 = long)
*/
+
4, /* size
*/
32, /* bitsize */
32, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_32", /* name */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_32", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x00000000, /* src_mask */
0xffffffff, /* dst_mask */
0x00000000, /* src_mask */
0xffffffff, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* A 32 bit into 48 bits absolute relocation. */
HOWTO (R_FR30_48, /* type */
0, /* rightshift */
/* A 32 bit into 48 bits absolute relocation. */
HOWTO (R_FR30_48, /* type */
0, /* rightshift */
-
2, /* size (0 = byte, 1 = short, 2 = long)
*/
+
4, /* size
*/
32, /* bitsize */
32, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
fr30_elf_i32_reloc, /* special_function */
"R_FR30_48", /* name */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
fr30_elf_i32_reloc, /* special_function */
"R_FR30_48", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x00000000, /* src_mask */
0xffffffff, /* dst_mask */
0x00000000, /* src_mask */
0xffffffff, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* A 6 bit absolute relocation. */
HOWTO (R_FR30_6_IN_4, /* type */
2, /* rightshift */
/* A 6 bit absolute relocation. */
HOWTO (R_FR30_6_IN_4, /* type */
2, /* rightshift */
-
1, /* size (0 = byte, 1 = short, 2 = long)
*/
+
2, /* size
*/
6, /* bitsize */
6, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
4, /* bitpos */
complain_overflow_unsigned, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_6_IN_4", /* name */
4, /* bitpos */
complain_overflow_unsigned, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_6_IN_4", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x0000, /* src_mask */
0x00f0, /* dst_mask */
0x0000, /* src_mask */
0x00f0, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* An 8 bit absolute relocation. */
HOWTO (R_FR30_8_IN_8, /* type */
0, /* rightshift */
/* An 8 bit absolute relocation. */
HOWTO (R_FR30_8_IN_8, /* type */
0, /* rightshift */
-
1, /* size (0 = byte, 1 = short, 2 = long)
*/
+
2, /* size
*/
8, /* bitsize */
8, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
4, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc,/* special_function */
"R_FR30_8_IN_8", /* name */
4, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc,/* special_function */
"R_FR30_8_IN_8", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* A 9 bit absolute relocation. */
HOWTO (R_FR30_9_IN_8, /* type */
1, /* rightshift */
/* A 9 bit absolute relocation. */
HOWTO (R_FR30_9_IN_8, /* type */
1, /* rightshift */
-
1, /* size (0 = byte, 1 = short, 2 = long)
*/
+
2, /* size
*/
9, /* bitsize */
9, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
4, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc,/* special_function */
"R_FR30_9_IN_8", /* name */
4, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc,/* special_function */
"R_FR30_9_IN_8", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* A 10 bit absolute relocation. */
HOWTO (R_FR30_10_IN_8, /* type */
2, /* rightshift */
/* A 10 bit absolute relocation. */
HOWTO (R_FR30_10_IN_8, /* type */
2, /* rightshift */
-
1, /* size (0 = byte, 1 = short, 2 = long)
*/
+
2, /* size
*/
10, /* bitsize */
10, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
4, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc,/* special_function */
"R_FR30_10_IN_8", /* name */
4, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc,/* special_function */
"R_FR30_10_IN_8", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
0x0000, /* src_mask */
0x0ff0, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* A PC relative 9 bit relocation, right shifted by 1. */
HOWTO (R_FR30_9_PCREL, /* type */
1, /* rightshift */
/* A PC relative 9 bit relocation, right shifted by 1. */
HOWTO (R_FR30_9_PCREL, /* type */
1, /* rightshift */
-
1, /* size (0 = byte, 1 = short, 2 = long)
*/
+
2, /* size
*/
9, /* bitsize */
9, /* bitsize */
-
TRUE
, /* pc_relative */
+
true
, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_9_PCREL", /* name */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_9_PCREL", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x0000, /* src_mask */
0x00ff, /* dst_mask */
0x0000, /* src_mask */
0x00ff, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* A PC relative 12 bit relocation, right shifted by 1. */
HOWTO (R_FR30_12_PCREL, /* type */
1, /* rightshift */
/* A PC relative 12 bit relocation, right shifted by 1. */
HOWTO (R_FR30_12_PCREL, /* type */
1, /* rightshift */
-
1, /* size (0 = byte, 1 = short, 2 = long)
*/
+
2, /* size
*/
12, /* bitsize */
12, /* bitsize */
-
TRUE
, /* pc_relative */
+
true
, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_12_PCREL", /* name */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_FR30_12_PCREL", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0x0000, /* src_mask */
0x07ff, /* dst_mask */
0x0000, /* src_mask */
0x07ff, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_FR30_GNU_VTINHERIT, /* type */
0, /* rightshift */
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_FR30_GNU_VTINHERIT, /* type */
0, /* rightshift */
-
2, /* size (0 = byte, 1 = short, 2 = long)
*/
+
4, /* size
*/
0, /* bitsize */
0, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
NULL, /* special_function */
"R_FR30_GNU_VTINHERIT", /* name */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
NULL, /* special_function */
"R_FR30_GNU_VTINHERIT", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
0, /* src_mask */
0, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
HOWTO (R_FR30_GNU_VTENTRY, /* type */
0, /* rightshift */
/* GNU extension to record C++ vtable member usage */
HOWTO (R_FR30_GNU_VTENTRY, /* type */
0, /* rightshift */
-
2, /* size (0 = byte, 1 = short, 2 = long)
*/
+
4, /* size
*/
0, /* bitsize */
0, /* bitsize */
-
FALSE
, /* pc_relative */
+
false
, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
_bfd_elf_rel_vtable_reloc_fn, /* special_function */
"R_FR30_GNU_VTENTRY", /* name */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
_bfd_elf_rel_vtable_reloc_fn, /* special_function */
"R_FR30_GNU_VTENTRY", /* name */
-
FALSE
, /* partial_inplace */
+
false
, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
0, /* src_mask */
0, /* dst_mask */
-
FALSE
), /* pcrel_offset */
+
false
), /* pcrel_offset */
};
\f
/* Utility to actually perform an R_FR30_20 reloc. */
};
\f
/* Utility to actually perform an R_FR30_20 reloc. */
@@
-367,7
+367,7
@@
fr30_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
/* Set the howto pointer for an FR30 ELF reloc. */
/* Set the howto pointer for an FR30 ELF reloc. */
-static
void
+static
bool
fr30_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
fr30_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
@@
-378,10
+378,13
@@
fr30_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
if (r_type >= (unsigned int) R_FR30_max)
{
/* xgettext:c-format */
if (r_type >= (unsigned int) R_FR30_max)
{
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: invalid FR30 reloc number: %d"), abfd, r_type);
- r_type = 0;
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
}
cache_ptr->howto = & fr30_elf_howto_table [r_type];
}
cache_ptr->howto = & fr30_elf_howto_table [r_type];
+ return true;
}
\f
/* Perform a single relocation. By default we use the standard BFD
}
\f
/* Perform a single relocation. By default we use the standard BFD
@@
-494,7
+497,7
@@
fr30_final_link_relocate (reloc_howto_type *howto,
section, which means that the addend must be adjusted
accordingly. */
section, which means that the addend must be adjusted
accordingly. */
-static
bfd_boolean
+static
int
fr30_elf_relocate_section (bfd *output_bfd,
struct bfd_link_info *info,
bfd *input_bfd,
fr30_elf_relocate_section (bfd *output_bfd,
struct bfd_link_info *info,
bfd *input_bfd,
@@
-546,11
+549,11
@@
fr30_elf_relocate_section (bfd *output_bfd,
name = bfd_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);
- name =
(name == NULL) ? bfd_section_name (input_bfd,
sec) : name;
+ name =
name == NULL ? bfd_section_name (
sec) : name;
}
else
{
}
else
{
- b
fd_boolean
unresolved_reloc, warned, ignored;
+ b
ool
unresolved_reloc, warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
r_symndx, symtab_hdr, sym_hashes,
@@
-584,7
+587,7
@@
fr30_elf_relocate_section (bfd *output_bfd,
case bfd_reloc_undefined:
(*info->callbacks->undefined_symbol)
case bfd_reloc_undefined:
(*info->callbacks->undefined_symbol)
- (info, name, input_bfd, input_section, rel->r_offset,
TRUE
);
+ (info, name, input_bfd, input_section, rel->r_offset,
true
);
break;
case bfd_reloc_outofrange:
break;
case bfd_reloc_outofrange:
@@
-610,7
+613,7
@@
fr30_elf_relocate_section (bfd *output_bfd,
}
}
}
}
- return
TRUE
;
+ return
true
;
}
\f
/* Return the section that should be marked against GC for a given
}
\f
/* Return the section that should be marked against GC for a given
@@
-638,7
+641,7
@@
fr30_elf_gc_mark_hook (asection *sec,
Since we don't do .gots or .plts, we just need to consider the
virtual table relocs for gc. */
Since we don't do .gots or .plts, we just need to consider the
virtual table relocs for gc. */
-static b
fd_boolean
+static b
ool
fr30_elf_check_relocs (bfd *abfd,
struct bfd_link_info *info,
asection *sec,
fr30_elf_check_relocs (bfd *abfd,
struct bfd_link_info *info,
asection *sec,
@@
-650,7
+653,7
@@
fr30_elf_check_relocs (bfd *abfd,
const Elf_Internal_Rela *rel_end;
if (bfd_link_relocatable (info))
const Elf_Internal_Rela *rel_end;
if (bfd_link_relocatable (info))
- return
TRUE
;
+ return
true
;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
@@
-678,21
+681,19
@@
fr30_elf_check_relocs (bfd *abfd,
Reconstruct it for later use during GC. */
case R_FR30_GNU_VTINHERIT:
if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
Reconstruct it for later use during GC. */
case R_FR30_GNU_VTINHERIT:
if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return
FALSE
;
+ return
false
;
break;
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_FR30_GNU_VTENTRY:
break;
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
case R_FR30_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return false;
break;
}
}
break;
}
}
- return
TRUE
;
+ return
true
;
}
\f
#define ELF_ARCH bfd_arch_fr30
}
\f
#define ELF_ARCH bfd_arch_fr30