bool bfd_generic_discard_group (bfd *abfd, asection *group);
+bool bfd_section_size_insane (bfd *abfd, asection *sec);
+
/* Extracted from syms.c. */
typedef struct bfd_symbol
{
if (p == NULL
&& compress_status != COMPRESS_SECTION_DONE
- && _bfd_section_size_insane (abfd, sec))
+ && bfd_section_size_insane (abfd, sec))
{
/* PR 24708: Avoid attempts to allocate a ridiculous amount
of memory. */
|| sec->rawsize != 0
|| sec->contents != NULL
|| sec->compress_status != COMPRESS_SECTION_NONE
- || _bfd_section_size_insane (abfd, sec))
+ || bfd_section_size_insane (abfd, sec))
{
bfd_set_error (bfd_error_invalid_operation);
return false;
return false;
}
- if (_bfd_section_size_insane (abfd, msec))
+ if (bfd_section_size_insane (abfd, msec))
{
/* PR 26946 */
_bfd_error_handler (_("DWARF error: section %s is too big"),
msec;
msec = find_debug_info (debug_bfd, debug_sections, msec))
{
- if (_bfd_section_size_insane (debug_bfd, msec))
+ if (bfd_section_size_insane (debug_bfd, msec))
goto restore_vma;
/* Catch PR25070 testcase overflowing size calculation here. */
if (total_size + msec->size < total_size)
unsigned int r_type) ATTRIBUTE_HIDDEN;
/* Extracted from section.c. */
-bool _bfd_section_size_insane (bfd *abfd, asection *sec) ATTRIBUTE_HIDDEN;
-
/* Extracted from stabs.c. */
bool _bfd_link_section_stabs
(bfd *, struct stab_info *, asection *, asection *, void **,
}
/*
-INTERNAL_FUNCTION
- _bfd_section_size_insane
+FUNCTION
+ bfd_section_size_insane
SYNOPSIS
- bool _bfd_section_size_insane (bfd *abfd, asection *sec);
+ bool bfd_section_size_insane (bfd *abfd, asection *sec);
DESCRIPTION
Returns true if the given section has a size that indicates
*/
bool
-_bfd_section_size_insane (bfd *abfd, asection *sec)
+bfd_section_size_insane (bfd *abfd, asection *sec)
{
bfd_size_type size = bfd_get_section_limit_octets (abfd, sec);
if (size == 0)
z_stream strm;
int rc;
- /* Similar to _bfd_section_size_insane() in the BFD library we expect an
+ /* Similar to bfd_section_size_insane() in the BFD library we expect an
upper limit of ~10x compression. Any compression larger than that is
thought to be due to fuzzing of the compression header. */
if (uncompressed_size > file_size * 10)