forked from Imagelibrary/binutils-gdb
sec->alloced and freeing section contents
This modifies _bfd_elf_free_cached_info to unmap/free section contents. To do that we need to *not* free sections where contents are bfd_alloc'd or point to constant strings or somesuch. I've chosen to implement this be adding another flag to struct bfd_section, "alloced" to say the section contents can't be freed. Most of the patch is about setting that flag in many places.
This commit is contained in:
@@ -1857,6 +1857,7 @@ ldelf_before_allocation (char *audit, char *depaudit,
|
||||
if (default_interpreter_name != NULL)
|
||||
{
|
||||
sinterp->contents = (bfd_byte *) default_interpreter_name;
|
||||
sinterp->alloced = 1;
|
||||
sinterp->size = strlen ((char *) sinterp->contents) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user