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: binutils problem


Richard Zidlicky <rz@linux-m68k.org> writes:

|> On Fri, Aug 23, 2002 at 10:07:32PM -0700, H. J. Lu wrote:
|> > I don't know much about m68k. Does anyone have any ideas?
|> 
|> I have produced a much smaller testcase:
|> 
|> ======
|> 	.section	.rodata.str1.1,"aMS",@progbits,1
|> .LC1:
|> 	.string	"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|> 
|> 
|> .LC88:  .string "__builtin_memcpy"
|> 
|> 	.text
|> 	.align	2
|> 	.globl	foobar
|> 	.type	foobar,@function
|> foobar:
|> 	pea .LC88+10
|> 
|> 	.align	2
|> =======
|> 
|> objdump -x shows:
|> 
|> RELOCATION RECORDS FOR [.text]:
|> OFFSET   TYPE              VALUE 
|> 00000002 R_68K_32          .LC88+0x00000033
|> 
|> this is wrong, the 0x33 are from start of the section.

Here is a patch:

2002-08-24  Andreas Schwab  <schwab@suse.de>

	* config/tc-m68k.c (tc_m68k_fix_adjustable): Don't adjust symbols
	in merge sections.

Index: gas/config/tc-m68k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.c,v
retrieving revision 1.40
diff -u -p -a -u -p -a -r1.40 gas/config/tc-m68k.c
--- gas/config/tc-m68k.c	20 Aug 2002 23:49:27 -0000	1.40
+++ gas/config/tc-m68k.c	24 Aug 2002 16:28:21 -0000
@@ -848,6 +848,10 @@ tc_m68k_fix_adjustable (fixP)
   if (! relaxable_symbol (fixP->fx_addsy))
     return 0;
 
+  /* Don't adjust symbols in merge sections.  */
+  if ((S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE) != 0)
+    return 0;
+
   /* adjust_reloc_syms doesn't know about the GOT */
   switch (fixP->fx_r_type)
     {

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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