[PATCH v1 1/1] bfd: microblaze: Fix automated build errors

Vladimir Mezentsev vladimir.mezentsev@oracle.com
Sat Oct 7 18:56:54 GMT 2023



On 10/7/23 00:11, Neal Frager wrote:
> This patch fixes the following automated build errors:
> https://builder.sourceware.org/buildbot/#/builders/80/builds/2101/steps/4/logs/stdio
> https://builder.sourceware.org/buildbot/#/builders/72/builds/3405/steps/4/logs/stdio
>
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
>   bfd/elf32-microblaze.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
> index a8ced43c08a..96bb63fbd2e 100644
> --- a/bfd/elf32-microblaze.c
> +++ b/bfd/elf32-microblaze.c
> @@ -1986,7 +1986,7 @@ microblaze_elf_relax_section (bfd *abfd,
>   		/* Validate the in-band val.  */
>   		val = bfd_get_32 (abfd, contents + irel->r_offset);
>   		if (val != irel->r_addend && ELF32_R_TYPE (irel->r_info) == R_MICROBLAZE_32_NONE) {
> -		    fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend);
> +		    fprintf(stderr, "%d: CORRUPT relax reloc %x %x\n", __LINE__, val, irel->r_addend);

The type of irel->r_addend is "bfd_vma".
"bfd_vma" can be "unsigned long" or "unsigned int".

Perhaps the correct fix is:
   fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, (unsigned long) irel->r_addend);
or
   fprintf(stderr, "%d: CORRUPT relax reloc %x %llx\n", __LINE__, val, (unsigned long long) irel->r_addend);



More information about the Binutils mailing list