Patch for avr port of binutils [adiw, sbiw, ldd with more functionality]

Nick Clifton nickc@redhat.com
Wed Dec 22 14:25:00 GMT 2004


Hi Klaus,

>>   * The file bfd-in2.h is an automatically generated file.  If you 
>> need to patch it, you should also patch the source file(s) that are 
>> used to create it.  In this particular case the new relocs that you 
>> created needed to be added to the bfd/reloc.c file.
>>
> OK, thanks for this info. I downloaded the version (041119) via a single 
> file not from cvs. And bfd-in2.h was contained there :-(??

Yes - binutils does not force ordinary users to create these generated 
files, it provides them in a pre-generated format.  Developers however 
need to be aware of them, and make sure that they modify the source 
files upon which they are based.  When a new release is made the 
generated files will be rebuilt and we do not want to miss any changes.

> I have removed it from my sources and bring the change into bfd/relocs.c.
> But after that I was not longer able to build? What I have to typ for a 
> rebuild of the internal generated header files?

The secret incantation is "make headers".  Do this in the bfd/ directory 
of your build tree (not your source tree).

> If you are interested in 
> changing the complete avr-related files I can do this also but please
> after this patch. So that I am able to keep track and not through all 
> the things together :-)

Oh absolutely.  If you do want to update these files it would be very 
nice, but only as a completely separate patch, not when making other 
changes.  Alternatively one day I will get around to doing it myself :-)

> Ups, yes. I need a bit assistent from you. Is there a tool for 
> checking/auto formatting available?

Sadly no.  You have to rely upon experience and observation of other, 
conforming source files.  The standard is documented however:

http://www.gnu.org/prep/standards/standards.html

There might be a helpful .vimrc file, but I am not aware of it.
Since I am an emacs user I am not experienced in these things.

> There is actually no testsuite for avr. Sorry!

You could always start one - it would be very helpful.  The lack off a 
new test will not stop me accepting the patch however.

So - I have accepted and applied your revised patch.  I updated the
ChangeLog entries slightly so that they now read:

bfd/ChangeLog
2004-12-22  Klaus Rudolph  <lts-rudolph@gmx.de>

	* reloc.c: Add new relocs R_AVR_LDI, R_AVR_6, R_AVR_6_ADIW.
	* bfd-in2.h: Regenerate.
	* elf32-avr.c (elf_avr_nowto_table): Add the new relocs.
	(avr_reloc_map): Likewise.
	(avr_final_link_relocate): Likewise.

gas/ChangeLog
2004-12-22  Klaus Rudolph  <lts-rudolph@gmx.de>

	* config/tc-avr.c: Add support for the new R_AVR_LDI, R_AVR_6 and
	R_AVR_6_ADIW relocs for the LDI, ADIW/SBIW and LDD/STD
	instructions.
	(avr_offset_expression): New function to parse offsets for LDI
	instructions.
	(avr_operand): Use it.
	(md_apply_fix3): Generate the relocs.

include/elf/ChangeLog
2004-12-22  Klaus Rudolph  <lts-rudolph@gmx.de>
	
	* include/elf/avr.h (R_AVR_LDI, R_AVR_6, R_AVR_6_ADIW): New
	relocs.

Cheers
   Nick




More information about the Binutils mailing list