This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] R_ALPHA_RELATIVE addend
- To: Ulrich Drepper <drepper at cygnus dot com>
- Subject: [PATCH] R_ALPHA_RELATIVE addend
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 31 Aug 2001 20:28:01 +0200
- Cc: Richard Henderson <rth at redhat dot com>, binutils at sources dot redhat dot com
- References: <20010831152137.H550@sunsite.ms.mff.cuni.cz> <20010831091247.A5334@redhat.com> <20010831122146.L25384@devserv.devel.redhat.com> <20010831102335.A5472@redhat.com> <m3heuop2h3.fsf@otr.mynet> <20010831135033.N25384@devserv.devel.redhat.com> <m3ae0gp0x3.fsf@otr.mynet>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Fri, Aug 31, 2001 at 10:57:44AM -0700, Ulrich Drepper wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
>
> > But unless it is for RTLD_BOOTSTRAP only (in which case you know how ld.so
> > has been linked),
>
> Why? There are two different pieces of code handling _RELATIVE
> relocations depending on whether DT_RELACOUNT is available.
>
> The code in elf_machine_rela would stay as it is. The code in
> elf_machine_rela_relative can use the addend.
Ok, then it should be done now or very RSN (we already have several
bins/libs with DT_RELACOUNT for alpha out there), provided Richard decides
to do that.
Here is what I think should be changed in bfd, so that R_ALPHA_RELATIVE's
r_addend is equal to the memory location after linking.
2001-08-31 Jakub Jelinek <jakub@redhat.com>
* bfd/elf64-alpha.c (elf64_alpha_relocate_section): Duplicate memory
value into R_ALPHA_RELATIVE's addend.
(elf64_alpha_finish_dynamic_symbol): Likewise.
--- elf64-alpha.c.jj Fri Aug 31 20:10:45 2001
+++ elf64-alpha.c Fri Aug 31 20:16:32 2001
@@ -3613,7 +3613,7 @@ elf64_alpha_relocate_section (output_bfd
+ sgot->output_offset
+ gotent->got_offset);
outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
- outrel.r_addend = 0;
+ outrel.r_addend = relocation + addend;
bfd_elf64_swap_reloca_out (output_bfd, &outrel,
((Elf64_External_Rela *)
@@ -3678,7 +3678,7 @@ elf64_alpha_relocate_section (output_bfd
else if (info->shared && (input_section->flags & SEC_ALLOC))
{
outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
- outrel.r_addend = 0;
+ outrel.r_addend = relocation + addend;
}
else
goto default_reloc;
@@ -3871,7 +3871,7 @@ elf64_alpha_finish_dynamic_symbol (outpu
+ sgot->output_offset
+ gotent->got_offset);
outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
- outrel.r_addend = 0;
+ outrel.r_addend = plt_addr;
bfd_elf64_swap_reloca_out (output_bfd, &outrel,
((Elf64_External_Rela *)
Jakub