This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, avr] Add DIFF relocations


On Thu, Apr 10, 2014 at 12:51:43PM -0600, Tom Tromey wrote:
> >>>>> "Denis" == Denis Chertykov <chertykov@gmail.com> writes:
> 
> >> * reloc.c: Add BFD_RELOC_AVR_DIFF8/16/32 relocations
> 
> Denis> Committed.
> 
> On x86-64 Fedora 20, with --enable-targets=all, I get:
> 
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/bfd -I. -I../../binutils-gdb/bfd -I../../binutils-gdb/bfd/../include -DHAVE_all_vecs -DBINDIR=\"/home/tromey/gnu/gdb/devel/install/bin\" -g3 -gdwarf-4 -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g3 -gdwarf-4 -MT elf32-avr.lo -MD -MP -MF .deps/elf32-avr.Tpo -c ../../binutils-gdb/bfd/elf32-avr.c -o elf32-avr.o
> ../../binutils-gdb/bfd/elf32-avr.c:650:5: error: âBFD_RELOC_AVR_DIFF8â undeclared here (not in a function)
>    { BFD_RELOC_AVR_DIFF8,            R_AVR_DIFF8 },
>      ^
> ../../binutils-gdb/bfd/elf32-avr.c:651:5: error: âBFD_RELOC_AVR_DIFF16â undeclared here (not in a function)
>    { BFD_RELOC_AVR_DIFF16,           R_AVR_DIFF16 },
>      ^
> ../../binutils-gdb/bfd/elf32-avr.c:652:5: error: âBFD_RELOC_AVR_DIFF32â undeclared here (not in a function)
>    { BFD_RELOC_AVR_DIFF32,           R_AVR_DIFF32 }
>      ^
> make[4]: *** [elf32-avr.lo] Error 1

The original patch did not include automatically generated files. The
patch below has just those files. Sorry for breaking the build, I
thought excluding the generated files would make the patch easier to
review.

Could someone commit please? I don't have commit access.

Regards
Senthil

bfd/ChangeLog

2014-04-11  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* Add BFD_RELOC_AVR_DIFF8/16/32.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.


diff --git bfd/bfd-in2.h bfd/bfd-in2.h
index cd45d71..f9854ed 100644
--- bfd/bfd-in2.h
+++ bfd/bfd-in2.h
@@ -4460,6 +4460,16 @@ in .byte hi8(symbol)  */
 in .byte hlo8(symbol)  */
   BFD_RELOC_AVR_8_HLO,
 
+/* AVR relocations to mark the difference of two local symbols.
+These are only needed to support linker relaxation and can be ignored
+when not relaxing.  The field is set to the value of the difference
+assuming no relaxation.  The relocation encodes the position of the
+second symbol so the linker can determine whether to adjust the field
+value.  */
+  BFD_RELOC_AVR_DIFF8,
+  BFD_RELOC_AVR_DIFF16,
+  BFD_RELOC_AVR_DIFF32,
+
 /* Renesas RL78 Relocations.  */
   BFD_RELOC_RL78_NEG8,
   BFD_RELOC_RL78_NEG16,
diff --git bfd/libbfd.h bfd/libbfd.h
index f836f3f..f98a224 100644
--- bfd/libbfd.h
+++ bfd/libbfd.h
@@ -2039,6 +2039,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_AVR_8_LO",
   "BFD_RELOC_AVR_8_HI",
   "BFD_RELOC_AVR_8_HLO",
+  "BFD_RELOC_AVR_DIFF8",
+  "BFD_RELOC_AVR_DIFF16",
+  "BFD_RELOC_AVR_DIFF32",
   "BFD_RELOC_RL78_NEG8",
   "BFD_RELOC_RL78_NEG16",
   "BFD_RELOC_RL78_NEG24",


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]