This is the mail archive of the binutils@sourceware.org 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: [PATCH]: Sparc GOTDATA optimizations.


Hi David,

bfd/
2010-02-07  David S. Miller<davem@davemloft.net>

	* elfxx-sparc.c (_bfd_sparc_elf_check_relocs): For R_SPARC_GOTDATA_OP_HIX22
	and R_SPARC_GOTDATA_OP_LOX10, only bump the GOT refcount for global
	symbols.
	(_bfd_sparc_elf_gc_sweep_hook): Likewise only decrement the GOT count for
	these relocs on global symbols.
	(gdopoff): New.
	(_bfd_sparc_elf_relocate_section): Perform GOTDATA optimizations on
	local symbol references which are not STT_GNU_IFUNC.  Handle
	relocation of them like R_SPARC_HIX22 and R_SPARC_LOX10 respectively,
	and deal with negative vs. non-negative values properly.

ld/testsuite
	* ld-sparc/gotop32.s: Add local symbol case.
	* ld-sparc/gotop64.s: Likewise.
	* ld-sparc/gotop32.rd: Adjust expected results.
	* ld-sparc/gotop32.td: Likewise.
	* ld-sparc/gotop64.dd: Likewise.
	* ld-sparc/gotop64.rd: Likewise.
	* ld-sparc/gotop64.td: Likewise.

Approved - please apply.


Note - there appear to be a few, very minor, formatting issues with the patch, where a whitespace character and an operator symbol appear to have swapped positions. Eg:

+ if (local_got_refcounts[r_symndx]> 0)

I would have expected:


> + if (local_got_refcounts[r_symndx] > 0)

Similarly for:

+ || (bfd_signed_vma) relocation< 0)

+ || (bfd_signed_vma) relocation< 0)

+ relocation = (relocation& 0x3ff) | 0x1c00;

+ relocation = (relocation& 0x3ff);

Cheers Nick


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