This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: section-relative relocs on ia64 (was: Re: Why does slurp_ia64_unwind_table complain unwind symbol type?)
On Tue, Oct 26, 2004 at 02:35:34AM -0700, David Mosberger wrote:
>
> OK, I'll submit a bug-report. Turns out I misread the ia64 ABI a bit:
> what GAS does at the moment is wrong, but for another reason than I
> though. I'll provide the details in the bug-report.
>
Here is a patch.
H.J.
----
2004-10-26 H.J. Lu <hongjiu.lu@intel.com>
PR 475
* elfxx-ia64.c (elfNN_ia64_relocate_section): Correct
R_IA64_SECREL32MSB, R_IA64_SECREL32LSB, R_IA64_SECREL64MSB
and R_IA64_SECREL64LSB.
--- bfd/elfxx-ia64.c.secrel 2004-10-26 11:37:53.000000000 -0700
+++ bfd/elfxx-ia64.c 2004-10-26 14:10:05.480473581 -0700
@@ -4374,11 +4374,9 @@ elfNN_ia64_relocate_section (output_bfd,
case R_IA64_SECREL32LSB:
case R_IA64_SECREL64MSB:
case R_IA64_SECREL64LSB:
- /* Make output-section relative. */
- if (value > input_section->output_section->vma)
- value -= input_section->output_section->vma;
- else
- value = 0;
+ /* Make output-section relative to section where the symbol
+ is defined. PR 475 */
+ value -= sym_sec->output_section->vma;
r = elfNN_ia64_install_value (hit_addr, value, r_type);
break;