[PATCH] MSP430: Support relocations for subtract expressions in .uleb128 directives

Jozef Lawrynowicz jozef.l@mittosystems.com
Tue Sep 8 15:07:42 GMT 2020
On Tue, Sep 08, 2020 at 11:01:17AM +0100, Nick Clifton via Binutils wrote:
> Hi Jozef,
> 
> > I've attached an updated patch with the following changes:
> > - "GNU" used in new reloc names
> > - uleb128 write function moved to bfd/libbfd.c
> > - uleb128 write function takes an end pointer argument and will not
> >   overwrite memory beyond this
> > - relocated uleb128 value is "right aligned" within the available space
> > 
> > Successfully re-tested the patch.
> > 
> > Ok to apply?
> 
> Thanks for making these adjustments.  The patch is approved, but
> it needs one small change before applying:
> 
> 	  _bfd_error_handler
> 	    (_("error: final size of uleb128 value at offset 0x%lx in %pA "
> 	       "from %pB exceeds available space"),
> 	     rel->r_offset, input_section, input_bfd);
> 
> This line generates an error when compiling for a 64-bit target (eg --enable-targets=all)
> because rel->r_offset is a long long but the print type is %0lx.  So if you could
> add a cast, that would be great:
> 
> 	  _bfd_error_handler
> 	    (_("error: final size of uleb128 value at offset 0x%lx in %pA "
> 	       "from %pB exceeds available space"),
> 	     (long) rel->r_offset, input_section, input_bfd);

Thanks for spotting that.

However, I'm not able to reproduce the error. I'd like to add this
configuration to my build system to spot any issues in the future.
I tried the following configure lines, but the build completes successfully
in both cases:

  ../configure --enable-targets=all --enable-werror
  ../configure --enable-targets=all --enable-werror --target=msp430-elf

Are there any additional options I need to add?

Thanks,
Jozef


More information about the Binutils mailing list