bfd/ELF: refine segment index in filepos assignment diag

Message ID 6009e9c5-0a4d-46bd-ae25-0a706f2772fc@suse.com
State New
Headers
Series bfd/ELF: refine segment index in filepos assignment diag |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Jan Beulich Dec. 20, 2024, 10:52 a.m. UTC
  Reporting an internal loop index isn't helpful for the user to determine
which segment the problem is with. Report the PHDR index instead.
  

Patch

--- 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);
 		}
 	    }