This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: R_PPC_EMB_RELSDA is PC-relative?
This patch corrects a PowerPC EABI relocation, and fixes a couple of
comments. elf_discarded_section only works for input sections, which
is fairly obvious really, but it doesn't hurt to say so in the
comment. The comment for pc_relative is a little confusing for ELF
RELA targets since they store the addend separate from the section.
* elf32-ppc.c (ppc_elf_howto_raw <R_PPC_EMB_RELSDA>): Not pc-relative.
* bfd-in.h (elf_discarded_section): Clarify comment.
* reloc.c (struct reloc_howto_struct <pc_relative>): Likewise.
* bfd-in2.h: Regenerate.
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.279
diff -u -p -r1.279 elf32-ppc.c
--- bfd/elf32-ppc.c 19 Feb 2010 05:07:49 -0000 1.279
+++ bfd/elf32-ppc.c 25 Mar 2010 09:15:56 -0000
@@ -1380,7 +1380,7 @@ static reloc_howto_type ppc_elf_howto_ra
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
- TRUE, /* pc_relative */
+ FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
Index: bfd/bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.149
diff -u -p -r1.149 bfd-in.h
--- bfd/bfd-in.h 25 Jan 2010 06:47:16 -0000 1.149
+++ bfd/bfd-in.h 25 Mar 2010 09:15:23 -0000
@@ -294,7 +294,7 @@ typedef struct bfd_section *sec_ptr;
(((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
/ bfd_octets_per_byte (bfd))
-/* Return TRUE if section has been discarded. */
+/* Return TRUE if input section SEC has been discarded. */
#define elf_discarded_section(sec) \
(!bfd_is_abs_section (sec) \
&& bfd_is_abs_section ((sec)->output_section) \
Index: bfd/reloc.c
===================================================================
RCS file: /cvs/src/src/bfd/reloc.c,v
retrieving revision 1.200
diff -u -p -r1.200 reloc.c
--- bfd/reloc.c 18 Mar 2010 11:22:43 -0000 1.200
+++ bfd/reloc.c 25 Mar 2010 09:16:24 -0000
@@ -305,10 +305,7 @@ CODE_FRAGMENT
. when doing overflow checking. *}
. unsigned int bitsize;
.
-. {* Notes that the relocation is relative to the location in the
-. data section of the addend. The relocation function will
-. subtract from the relocation value the address of the location
-. being relocated. *}
+. {* The relocation is relative to the field being relocated. *}
. bfd_boolean pc_relative;
.
. {* The bit position of the reloc value in the destination.
--
Alan Modra
Australia Development Lab, IBM