[PATCH] bfd/ELF: refine segment index in filepos assignment diag

Jan Beulich jbeulich@suse.com
Fri Dec 20 10:52:38 GMT 2024


Reporting an internal loop index isn't helpful for the user to determine
which segment the problem is with. Report the PHDR index instead.

--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6401,8 +6401,8 @@ assign_file_positions_for_load_sections
 		{
 		  _bfd_error_handler
 		    /* xgettext:c-format */
-		    (_("%pB: section `%pA' can't be allocated in segment %d"),
-		     abfd, sec, j);
+		    (_("%pB: section `%pA' can't be allocated in segment %u"),
+		     abfd, sec, m->idx);
 		  print_segment_map (m);
 		}
 	    }


More information about the Binutils mailing list