[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS: cvs.openbsd.org: src



CVSROOT:	/cvs
Module name:	src
Changes by:	drahn_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org	2003/08/18 22:15:54

Modified files:
	libexec/ld.so/powerpc: rtld_machine.c 

Log message:
Fix PowerPC PLT generation. After 2^12 entries (2^14 offset), only every
other slot in the PLT is used, this is because it takes more than one
instruction to generate a constant > 2^14.

Normal PLT entry < 2^12
li r11, <n>		# where n is PLT index*4 (offset used for plttable).
b .pltresolve | .pltcall | target

PLT entry after 2^12
lis r11, <n>@ha
addi r11, r11, <n>@l	# where n is PLT index*4 (offset used for plttable).
b .pltresolve | .pltcall | target
nop 			# unused

This is all specified by the PowerPC SVID.

The PLT table generation code was never tested for entries > 2^12 before
and was broken. This fixes the indexing, the constant checking 12 vs 14, ...

This code has been tested with up to 128000+ functions.