From 578620305daedbf1e26c3a0e53208caa9714acbc Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 30 Jun 2026 06:37:05 +0800
Subject: [PATCH] readelf: Also set do_got_section_contents to false

Also set do_got_section_contents to false if section headers are failed
to load.

	PR binutils/34323
	* readelf.c (process_object): Also set do_got_section_contents.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 binutils/readelf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/binutils/readelf.c b/binutils/readelf.c
index bf27f9eec23..bf94f4d5caa 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -24938,7 +24938,8 @@ process_object (Filedata * filedata)
   if (! process_section_headers (filedata))
     {
       /* Without loaded section headers we cannot process lots of things.  */
-      do_unwind = do_version = do_dump = do_arch = false;
+      do_unwind = do_version = do_dump = do_arch
+	= do_got_section_contents = false;
 
       if (! do_using_dynamic)
 	do_syms = do_dyn_syms = do_reloc = false;
-- 
2.54.0

