This is the mail archive of the binutils@sources.redhat.com 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: ld of binutils 2.12 appends two (garbage?) bytes


On Sun, May 12, 2002 at 05:47:12PM -0700, Richard Henderson wrote:
> This was a lot more of a problem before you fixed ld so that
> we could properly insert nops larger than 2 bytes.  So I guess
> it doesn't make a big difference anymore.

Ah, OK.  I hadn't figured out why you made the change to gas.  This
makes me quite comfortable with:

gas/ChangeLog
	* write.c (subsegs_finish): Don't specially align last subseg.

More testsuite tweaks needed like the following are likely needed..

gas/testsuite/ChangeLog
	* gas/i386/x86-64-opcode.s: Pad out end of .text with zeros.
	* gas/i386/x86-64-opcode.d: Adjust.

Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.54
diff -u -p -r1.54 write.c
--- gas/write.c	1 May 2002 00:33:09 -0000	1.54
+++ gas/write.c	13 May 2002 01:17:50 -0000
@@ -1441,12 +1441,6 @@ subsegs_finish ()
          if we are generating a listing.  */
       alignment = had_errors () ? 0 : SUB_SEGMENT_ALIGN (now_seg);
 
-      /* The last subsegment gets an aligment corresponding to the
-	 alignment of the section.  This allows proper nop-filling
-	 at the end of code-bearing sections.  */
-      if (!frchainP->frch_next || frchainP->frch_next->frch_seg != now_seg)
-	alignment = get_recorded_alignment (now_seg);
-
       if (subseg_text_p (now_seg))
 	frag_align_code (alignment, 0);
       else
Index: gas/testsuite/gas/i386/x86-64-opcode.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/x86-64-opcode.s,v
retrieving revision 1.2
diff -u -p -r1.2 x86-64-opcode.s
--- gas/testsuite/gas/i386/x86-64-opcode.s	19 Mar 2002 12:17:58 -0000	1.2
+++ gas/testsuite/gas/i386/x86-64-opcode.s	13 May 2002 01:20:47 -0000
@@ -386,3 +386,5 @@
 	OUT %eax,$0		      #	 --  --	 -- --	 E7 00
 
 	# IN
+
+ .p2align 4,0
Index: gas/testsuite/gas/i386/x86-64-opcode.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/x86-64-opcode.d,v
retrieving revision 1.2
diff -u -p -r1.2 x86-64-opcode.d
--- gas/testsuite/gas/i386/x86-64-opcode.d	19 Mar 2002 12:17:57 -0000	1.2
+++ gas/testsuite/gas/i386/x86-64-opcode.d	13 May 2002 01:20:46 -0000
@@ -266,6 +266,4 @@ Disassembly of section .text:
 [	 ]*43a:[	 ]+e6 00[	 ]+out[	 ]+%al,\$0[x0]*[	 ]*(#.*)*
 [	 ]*43c:[	 ]+66 e7 00[	 ]+out[	 ]+%ax,\$0[x0]*[	 ]*(#.*)*
 [	 ]*43f:[	 ]+e7 00[	 ]+out[	 ]+%eax,\$0[x0]*[	 ]*(#.*)*
-.*nop.*
-.*nop.*
-.*nop.*
+[	 *]...

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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