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: Bad profiling code from gcc-3.2 for m68k-linux


Peter Barada <pbarada@mail.wm.sps.mot.com> writes:

|> I'm trying to build a m68k-linux gcc compiler for coldfire, and its
|> producing the follwoing code sequence for profiling:
|> 
|> tanMp:
|> 	link.w %a6,#-332
|> 	move.l %d2,-(%sp)
|> 	.data
|> 	.align	2
|> .LP1:
|> 	.long	0
|> 	.text
|> 	lea (.LP1,%pc),%a1
|> 	jbsr _mcount
|> 
|> The lea doesn't look right.  I'm assuming its trying to put the
|> address of .LP1 into %a1 before calling _mcount.  If so, that syntax
|> looks like its placing the *sum* of .LP1 and %pc into %a1.

That's correct.  The assembler makes .LP1 a pc-relative reference.

|> Should this be:
|> 
|> 	lea (.LP1@PLTPC,%pc),%a1
|> 
|> and what does @PLTPC (as well as @GOTPC, @GOT) mean?

That's for ELF style PIC.

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]