}
/* Read a section into its appropriate place in the dwarf2_debug
- struct (indicated by SECTION_BUFFER and SECTION_SIZE). If syms is
+ struct (indicated by SECTION_BUFFER and SECTION_SIZE). If SYMS is
not NULL, use bfd_simple_get_relocated_section_contents to read the
- section contents, otherwise use bfd_get_section_contents. */
+ section contents, otherwise use bfd_get_section_contents. Fail if
+ the located section does not contain at least OFFSET bytes. */
static bfd_boolean
-read_section (bfd *abfd,
- const char* section_name, const char* compressed_section_name,
- asymbol** syms, bfd_uint64_t offset,
- bfd_byte **section_buffer, bfd_size_type *section_size)
+read_section (bfd * abfd,
+ const char * section_name,
+ const char * compressed_section_name,
+ asymbol ** syms,
+ bfd_uint64_t offset,
+ bfd_byte ** section_buffer,
+ bfd_size_type * section_size)
{
asection *msec;
bfd_boolean section_is_compressed = FALSE;
}
/* It is possible to get a bad value for the offset into the section
- * that the client wants. Validate it here to avoid trouble later. */
+ that the client wants. Validate it here to avoid trouble later. */
if (offset != 0 && offset >= *section_size)
{
(*_bfd_error_handler) (_("Dwarf Error: Offset (%lu) greater than or equal to %s size (%lu)."),
- offset, section_name, *section_size);
+ (long) offset, section_name, *section_size);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
bfd_byte *buf,
unsigned int size ATTRIBUTE_UNUSED)
{
- /* If the size of a host char is 8 bits, we can return a pointer
- to the buffer, otherwise we have to copy the data to a buffer
- allocated on the temporary obstack. */
return buf;
}
{
/* Return a pointer to the embedded string. */
char *str = (char *) buf;
+
if (*str == '\0')
{
*bytes_read_ptr = 1;
return str;
}
+/* END VERBATIM */
+
static char *
-read_indirect_string (struct comp_unit* unit,
- bfd_byte *buf,
- unsigned int *bytes_read_ptr)
+read_indirect_string (struct comp_unit * unit,
+ bfd_byte * buf,
+ unsigned int * bytes_read_ptr)
{
bfd_uint64_t offset;
struct dwarf2_debug *stash = unit->stash;
offset = read_4_bytes (unit->abfd, buf);
else
offset = read_8_bytes (unit->abfd, buf);
+
*bytes_read_ptr = unit->offset_size;
if (! read_section (unit->abfd, ".debug_str", ".zdebug_str",
- 0, offset,
+ stash->syms, offset,
&stash->dwarf_str_buffer, &stash->dwarf_str_size))
- return 0;
+ return NULL;
str = (char *) stash->dwarf_str_buffer + offset;
if (*str == '\0')
return str;
}
-/* END VERBATIM */
-
static bfd_uint64_t
read_address (struct comp_unit *unit, bfd_byte *buf)
{
bfd_elf_generic_reloc, /* special_function */
"R_CR16_NUM8", /* name */
FALSE, /* partial_inplace */
- 0xff, /* src_mask */
+ 0x0, /* src_mask */
0xff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_NUM16", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_NUM32", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_NUM32a", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL4", /* name */
FALSE, /* partial_inplace */
- 0xf, /* src_mask */
+ 0x0, /* src_mask */
0xf, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL4a", /* name */
FALSE, /* partial_inplace */
- 0xf, /* src_mask */
+ 0x0, /* src_mask */
0xf, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL14", /* name */
FALSE, /* partial_inplace */
- 0x3fff, /* src_mask */
+ 0x0, /* src_mask */
0x3fff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL14a", /* name */
FALSE, /* partial_inplace */
- 0x3fff, /* src_mask */
+ 0x0, /* src_mask */
0x3fff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL16", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL20", /* name */
FALSE, /* partial_inplace */
- 0xfffff, /* src_mask */
+ 0x0, /* src_mask */
0xfffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL20a", /* name */
FALSE, /* partial_inplace */
- 0xfffff, /* src_mask */
+ 0x0, /* src_mask */
0xfffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_ABS20", /* name */
FALSE, /* partial_inplace */
- 0xfffff, /* src_mask */
+ 0x0, /* src_mask */
0xfffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_ABS24", /* name */
FALSE, /* partial_inplace */
- 0xffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM4", /* name */
FALSE, /* partial_inplace */
- 0xf, /* src_mask */
+ 0x0, /* src_mask */
0xf, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM8", /* name */
FALSE, /* partial_inplace */
- 0xff, /* src_mask */
+ 0x0, /* src_mask */
0xff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM16", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM20", /* name */
FALSE, /* partial_inplace */
- 0xfffff, /* src_mask */
+ 0x0, /* src_mask */
0xfffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM24", /* name */
FALSE, /* partial_inplace */
- 0xffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM32", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM32a", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP4", /* name */
FALSE, /* partial_inplace */
- 0xf, /* src_mask */
+ 0x0, /* src_mask */
0xf, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP8", /* name */
FALSE, /* partial_inplace */
- 0x1ff, /* src_mask */
+ 0x0, /* src_mask */
0x1ff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP16", /* name */
FALSE, /* partial_inplace */
- 0x1ffff, /* src_mask */
+ 0x0, /* src_mask */
0x1ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* REVISIT: DISP24 should be left-shift by 2 as per ISA doc
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP24", /* name */
FALSE, /* partial_inplace */
- 0x1ffffff, /* src_mask */
+ 0x0, /* src_mask */
0x1ffffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP24a", /* name */
FALSE, /* partial_inplace */
- 0xffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_SWITCH8", /* name */
FALSE, /* partial_inplace */
- 0xff, /* src_mask */
+ 0x0, /* src_mask */
0xff, /* dst_mask */
TRUE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_SWITCH16", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
TRUE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CR16_SWITCH32", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
TRUE) /* pcrel_offset */
};
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section,
rel->r_offset)))
- return FALSE;
+ return FALSE;
break;
case bfd_reloc_undefined: