diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2021-10-06 14:58:33 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2022-04-14 06:25:27 +0100 |
commit | c751f5a2d03271a979aadba7ea6158cb25385671 (patch) | |
tree | 3ed487363237da1b52c7a7d02b7f241c6e0991d2 | |
parent | 1dcb779ece80e7eb31d4e9162ce1d626dee70b4f (diff) |
collect2: Fix missing cleanups.
The code that checks to see if objects have LTO content via
simple-object was not releasing resources, fixed thus.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:
* collect2.c (is_lto_object_file): Release simple-object
resources, close files.
(cherry picked from commit 43ae43f654749d291d871ca6ef7c96ea16580fad)
-rw-r--r-- | gcc/collect2.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c index 75658d75daf..3e212fc75f3 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -2337,10 +2337,15 @@ is_lto_object_file (const char *prog_name) LTO_SEGMENT_NAME, &errmsg, &err); if (!inobj) - return false; + { + close (infd); + return false; + } errmsg = simple_object_find_sections (inobj, has_lto_section, (void *) &found, &err); + simple_object_release_read (inobj); + close (infd); if (! errmsg && found) return true; |