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]

[gold patch] Add Swap_aligned32 template for writing gdb index


One portion of the gdb index is inevitably misaligned for 64-bit reads
and writes, as it's an array of 20-byte entries. We do, however, know
that that part of the index will at least be 32-bit aligned, so we can
take advantage of that knowledge to write the 64-bit values using two
32-bit writes instead of 8 8-bit writes. This patch adds a new
Swap_aligned32 template to elfcpp_swap.h, and uses that template when
writing the gdb index.

Tested on x86_64. (Should also be tested on sparc -- David, can you
try this out?)

OK to commit if OK on sparc?

-cary


2012-04-23  Cary Coutant  <ccoutant@google.com>

elfcpp/

	* elfcpp_swap.h (struct Swap_aligned32): New template.

gold/

	* gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
	CU range table of gdb index.

Attachment: gold-swap-align32-patch.txt
Description: Text document


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