/* BFD backend for Extended Tektronix Hex Format objects.
- Copyright (C) 1992-2015 Free Software Foundation, Inc.
+ Copyright (C) 1992-2016 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
return FALSE;
}
alt_section = NULL;
- while (*src)
+ while (src < src_end && *src)
{
switch (*src)
{
return FALSE;
if (!getvalue (&src, &val, src_end))
return FALSE;
+ if (val < section->vma)
+ val = section->vma;
section->size = val - section->vma;
+ /* PR 17512: file: objdump-s-endless-loop.tekhex.
+ Check for overlarge section sizes. */
+ if (section->size & 0x80000000)
+ return FALSE;
section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
break;
case '0':
else
{
if (alt_section == NULL)
- alt_section = bfd_get_next_section_by_name (section);
+ alt_section
+ = bfd_get_next_section_by_name (NULL, section);
if (alt_section == NULL)
alt_section = bfd_make_section_anyway_with_flags
(abfd, section->name,
else
{
if (alt_section == NULL)
- alt_section = bfd_get_next_section_by_name (section);
+ alt_section
+ = bfd_get_next_section_by_name (NULL, section);
if (alt_section == NULL)
alt_section = bfd_make_section_anyway_with_flags
(abfd, section->name,
#define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define tekhex_bfd_link_just_syms _bfd_generic_link_just_syms
-#define tekhex_bfd_copy_link_hash_symbol_type \
- _bfd_generic_copy_link_hash_symbol_type
+#define tekhex_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
#define tekhex_bfd_final_link _bfd_generic_final_link
#define tekhex_bfd_link_split_section _bfd_generic_link_split_section
#define tekhex_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define tekhex_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target tekhex_vec =
{