mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-25 10:52:00 +08:00
Fix reading of .debug_str_offsets{,.dwo} twice.
PR binutils/18218 * readelf.c (printable_section_name): Constify sec argument. (apply_relocations): Ditto. New arg "size". All callers updated. (load_specific_debug_section): Constify sec argument. Remove side-effect of modifying sec->sh_size.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2015-04-13 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
|
PR binutils/18218
|
||||||
|
* readelf.c (printable_section_name): Constify sec argument.
|
||||||
|
(apply_relocations): Ditto. New arg "size". All callers updated.
|
||||||
|
(load_specific_debug_section): Constify sec argument.
|
||||||
|
Remove side-effect of modifying sec->sh_size.
|
||||||
|
|
||||||
2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
|
2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* objcopy.c (do_debug_sections): Use bit patterns.
|
* objcopy.c (do_debug_sections): Use bit patterns.
|
||||||
|
@ -550,7 +550,7 @@ print_symbol (int width, const char *symbol)
|
|||||||
to print multibyte characters, it just interprets them as hex values. */
|
to print multibyte characters, it just interprets them as hex values. */
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
printable_section_name (Elf_Internal_Shdr * sec)
|
printable_section_name (const Elf_Internal_Shdr * sec)
|
||||||
{
|
{
|
||||||
#define MAX_PRINT_SEC_NAME_LEN 128
|
#define MAX_PRINT_SEC_NAME_LEN 128
|
||||||
static char sec_name_buf [MAX_PRINT_SEC_NAME_LEN + 1];
|
static char sec_name_buf [MAX_PRINT_SEC_NAME_LEN + 1];
|
||||||
@ -11633,11 +11633,11 @@ is_none_reloc (unsigned int reloc_type)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
apply_relocations (void * file,
|
apply_relocations (void * file,
|
||||||
Elf_Internal_Shdr * section,
|
const Elf_Internal_Shdr * section,
|
||||||
unsigned char * start)
|
unsigned char * start, bfd_size_type size)
|
||||||
{
|
{
|
||||||
Elf_Internal_Shdr * relsec;
|
Elf_Internal_Shdr * relsec;
|
||||||
unsigned char * end = start + section->sh_size;
|
unsigned char * end = start + size;
|
||||||
|
|
||||||
if (elf_header.e_type != ET_REL)
|
if (elf_header.e_type != ET_REL)
|
||||||
return;
|
return;
|
||||||
@ -11929,7 +11929,7 @@ dump_section_as_bytes (Elf_Internal_Shdr * section,
|
|||||||
|
|
||||||
if (relocate)
|
if (relocate)
|
||||||
{
|
{
|
||||||
apply_relocations (file, section, start);
|
apply_relocations (file, section, start, section->sh_size);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -12069,7 +12069,7 @@ uncompress_section_contents (unsigned char **buffer,
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
load_specific_debug_section (enum dwarf_section_display_enum debug,
|
load_specific_debug_section (enum dwarf_section_display_enum debug,
|
||||||
Elf_Internal_Shdr * sec, void * file)
|
const Elf_Internal_Shdr * sec, void * file)
|
||||||
{
|
{
|
||||||
struct dwarf_section * section = &debug_displays [debug].section;
|
struct dwarf_section * section = &debug_displays [debug].section;
|
||||||
char buf [64];
|
char buf [64];
|
||||||
@ -12109,7 +12109,6 @@ load_specific_debug_section (enum dwarf_section_display_enum debug,
|
|||||||
and the section size if uncompress is successful. */
|
and the section size if uncompress is successful. */
|
||||||
free (section->start);
|
free (section->start);
|
||||||
section->start = start;
|
section->start = start;
|
||||||
sec->sh_size = size;
|
|
||||||
}
|
}
|
||||||
section->size = size;
|
section->size = size;
|
||||||
}
|
}
|
||||||
@ -12118,7 +12117,7 @@ load_specific_debug_section (enum dwarf_section_display_enum debug,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (debug_displays [debug].relocate)
|
if (debug_displays [debug].relocate)
|
||||||
apply_relocations ((FILE *) file, sec, section->start);
|
apply_relocations ((FILE *) file, sec, section->start, section->size);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user