[PATCH v6 1/3] bfd: properly use bfd_get_symbol_leading_char in peXXigen.

Jan Beulich jbeulich@suse.com
Fri Apr 4 06:54:30 GMT 2025


On 03.04.2025 20:11, Jeremy Drake wrote:
> This function returns the leading char to use, so we cannot just assume
> it will always be '_' or '\0'.
> 
> After review, rationalize the error messages in
> _bfd_XXi_final_link_postscript.  They now all correctly refer to
> DataDirectory instead of DataDictionary, and use format strings so they
> only need one translation.

With that last aspect you went a little too far:

> @@ -4430,8 +4431,8 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
>        else
>  	{
>  	  _bfd_error_handler
> -	    (_("%pB: unable to fill in DataDictionary[1] because .idata$2 is missing"),
> -	     abfd);
> +	    (_("%pB: unable to fill in DataDirectory[%d]: %s not defined correctly"),
> +	     abfd, PE_IMPORT_TABLE, ".idata$2");

"is missing" is more precise than "not defined correctly", or at least more
helpful to the user. It's a section after all, not a symbol. Same for the
other .idata$<n> messages then, except for one (see below).

> @@ -4533,17 +4534,16 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo)
>  	  else
>  	    {
>  	      _bfd_error_handler
> -		(_("%pB: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE(12)]"
> -		   " because .idata$6 is missing"), abfd);
> +		(_("%pB: unable to fill in DataDirectory[%d]: %s not defined correctly"),
> +		 abfd, PE_IMPORT_ADDRESS_TABLE, "__IAT_end__");

This one I'm fine with. Still none of the above really belong in a patch under
the given title, so I'd like to ask that we split things, keeping right here
only what's further down (as it was before).

Judging from earlier commits of yours it looks like you may not have commit
rights. I'd be fine making said adjustments while committing on your behalf.

Jan


More information about the Binutils mailing list