aboutsummaryrefslogtreecommitdiff
path: root/gprofng/src
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2024-07-05 22:41:49 +0930
committerAlan Modra <amodra@gmail.com>2024-07-06 10:41:29 +0930
commit428c21e99a3a8e6b2c7fd204664764d7724f6272 (patch)
tree1e6b769e32a6d96128dcb0b55755bbc0a6b5a2cb /gprofng/src
parent69c21b8a2296cda07050cc55de0400fea10a695d (diff)
downloadbinutils-428c21e99a3a8e6b2c7fd204664764d7724f6272.zip
binutils-428c21e99a3a8e6b2c7fd204664764d7724f6272.tar.gz
binutils-428c21e99a3a8e6b2c7fd204664764d7724f6272.tar.bz2
objcopy bfd_map_over_sections and global status
This patch started life as a relatively simple change to fix some unimportant objcopy memory leaks, but expanded into a larger patch when I was annoyed by the awkwardness of passing data when using bfd_map_over_sections. A simple loop over sections is much more convenient, and we really don't need the abstraction layer. Sections in a list isn't going to disappear any time soon. The patch also removes use of the global "status" variable by all but the top-level functions called from main. * objcopy.c (filter_symbols): Return success as a bool. Pass symcount as a pointer, updated on return. (merge_gnu_build_notes): Similarly return a bool and add newsize param with updated smaller section size. (setup_bfd_headers): Return bool success rather than setting "status" on failure. (setup_section): Likewise. (copy_relocations_in_section, copy_section): Likewise, and adjust params. (mark_symbols_used_in_relocations): Likewise, and free memory on failure path. Don't call bfd_fatal. (get_sections): Delete function. (copy_object): Don't use bfd_map_over_sections, instead use a loop allowing easy detection of failure status. Free memory on error paths. (copy_archive): Return bool success rather than setting "status" on failure. (copy_file): Set "status" here. * testsuite/binutils-all/strip-13.d: Adjust to suit.
Diffstat (limited to 'gprofng/src')
0 files changed, 0 insertions, 0 deletions