aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2025-11-27 08:54:43 +1030
committerAlan Modra <amodra@gmail.com>2025-11-27 08:54:43 +1030
commit2600d751c34d127786fa50ab32c9d4f589181ee6 (patch)
treed48229286cc4c4bcd9a5f92a9b925e29daca91db /gdb/linux-nat.c
parentb15df2e0273735c0da4e1d257ac1ad1f56bb3a9c (diff)
downloadbinutils-2600d751c34d127786fa50ab32c9d4f589181ee6.zip
binutils-2600d751c34d127786fa50ab32c9d4f589181ee6.tar.gz
binutils-2600d751c34d127786fa50ab32c9d4f589181ee6.tar.bz2
Tidy .eh_frame rawsize manipulation
bfd_elf_discard_info is only called once. Well, it was until commit 9b854f169df9 introduced cmdline_emit_object_only_section, but I think and hope that function does enough reinitialisation to not cause a problem. There would be a problem if bfd_elf_discard_info was called iteratively, shrinking an eh_frame section on the first pass, then further shrinking on another pass. That's because _bfd_elf_discard_section_eh_frame uses rawsize to store the last section size, which is against the general rules for input sections. rawsize needs to be kept as the initial size to be able to read section contents again (or you'd need to cache the edited contents). Other eh_frame functions would break too. So this tidy makes it obvious when looking at _bfd_elf_discard_section_eh_frame alone that rawsize is only set once, to the initial size. There are no functional changes here. * elf-bfd.h (_bfd_elf_discard_section_eh_frame): Update decl. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Return an int status. Don't set rawsize unless it is zero. * elflink.c (bfd_elf_discard_info): Use new return status from _bfd_elf_discard_section_eh_frame rather than comparing section size with rawsize.
Diffstat (limited to 'gdb/linux-nat.c')
0 files changed, 0 insertions, 0 deletions