This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
gas, sparc, dwarf2, and R_SPARC_(UA)64
- From: DJ Delorie <dj at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 24 Jun 2004 14:01:02 -0400
- Subject: gas, sparc, dwarf2, and R_SPARC_(UA)64
The dwarf2 code in sparc's gas seems to want to emit R_SPARC_64
relocs, but these occasionally end up unaligned and the linker
complains. A simple patch to detect an unaligned frac and convert it
got most but not all of the alignment issues; there were still a few
R_SPARC_64 cases that ended up unaligned. Is there any reason why we
don't just use R_SPARC_UA64 all the time for dwarf2 info? There
doesn't seem to be a hook for that vs other cons expressions, though.
My current naive patch follows, a previous one also tested the
alignment of the reloc itself.
*** orig/binutils-2.14/gas/config/tc-sparc.c Fri Jan 24 18:44:44 2003
--- binutils-2.14/gas/config/tc-sparc.c Thu Jun 24 10:32:30 2004
***************
*** 4442,4447 ****
--- 4442,4457 ----
(nbytes == 2 ? BFD_RELOC_16 :
(nbytes == 4 ? BFD_RELOC_32 : BFD_RELOC_64)));
+ if (!sparc_no_align_cons)
+ {
+ /* This happens when gas's dwarf2 debug ops emit .debug_line
+ entries. */
+ sparc_no_align_cons = 1;
+ cons_fix_new_sparc (frag, where, nbytes, exp);
+ sparc_no_align_cons = 0;
+ return;
+ }
+
if (target_little_endian_data
&& nbytes == 4
&& now_seg->flags & SEC_ALLOC)