aboutsummaryrefslogtreecommitdiff
path: root/gas/output-file.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-01-11 15:31:06 +1030
committerAlan Modra <amodra@gmail.com>2023-01-11 15:31:06 +1030
commitda1f81c128b9be3cface7b0860085da8c6452510 (patch)
treeeafdbfa064bc45deb81d6d5dc8ea8655696a06b9 /gas/output-file.c
parent6647169da419fb3754c61aa6d89be2227405565a (diff)
downloadfsf-binutils-gdb-da1f81c128b9be3cface7b0860085da8c6452510.zip
fsf-binutils-gdb-da1f81c128b9be3cface7b0860085da8c6452510.tar.gz
fsf-binutils-gdb-da1f81c128b9be3cface7b0860085da8c6452510.tar.bz2
now_seg after closing output file
now_seg, a pointer into the output file sections, isn't valid after the output file is closed. gas doesn't and shouldn't use now_seg after this point of course, but let's be safe. * output-file.c (output_file_close): Clear now_seg and now_subseg.
Diffstat (limited to 'gas/output-file.c')
-rw-r--r--gas/output-file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gas/output-file.c b/gas/output-file.c
index 127dc73..0c3a811 100644
--- a/gas/output-file.c
+++ b/gas/output-file.c
@@ -99,6 +99,8 @@ output_file_close (void)
res = bfd_cache_close_all ();
else
res = bfd_close (obfd);
+ now_seg = NULL;
+ now_subseg = 0;
filename = out_file_name;
out_file_name = NULL;