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] Use unaligned access on x86_64


> To make sure I didn't break architectures with strict alignment, I
> started by building gold with -fsanitize=alignment.
>
> This found that even current master doesn't always align correctly.
> The backtrace of the first bug is attached.

#4  0x00000000005317ba in gold::Target_selector_nacl<(anonymous
namespace)::Target_selector_x86_64<64>, (anonymous
namespace)::Target_x86_64_nacl<64> >::do_recognize_nacl_file<64,
false> (this=0x37d2238 <(anonymous
namespace)::target_selector_x86_64>, input_file=0x3aa4560,
    offset=266628) at ../../binutils/gold/nacl.h:198
#5  0x0000000000530518 in gold::Target_selector_nacl<(anonymous
namespace)::Target_selector_x86_64<64>, (anonymous
namespace)::Target_x86_64_nacl<64> >::recognize_nacl_file
(this=0x37d2238 <(anonymous namespace)::target_selector_x86_64>,
input_file=0x3aa4560, offset=266628)
    at ../../binutils/gold/nacl.h:186
#6  0x0000000000505d9b in gold::Target_selector_nacl<(anonymous
namespace)::Target_selector_x86_64<64>, (anonymous
namespace)::Target_x86_64_nacl<64> >::do_recognize (this=0x37d2238
<(anonymous namespace)::target_selector_x86_64>, file=0x3aa4560,
offset=266628, machine=62, osabi=3,
    abiversion=0) at ../../binutils/gold/nacl.h:116
#7  0x00000000014da93c in gold::Target_selector::recognize
(this=0x37d2238 <(anonymous namespace)::target_selector_x86_64>,
input_file=0x3aa4560, offset=266628, machine=62, osabi=3,
abiversion=0) at ../../binutils/gold/target-select.h:82
#8  0x00000000014d9f4a in gold::select_target (input_file=0x3aa4560,
offset=266628, machine=62, size=64, is_big_endian=false, osabi=3,
abiversion=0) at ../../binutils/gold/target-select.cc:112
#9  0x00000000010086e1 in (anonymous
namespace)::make_elf_sized_object<64, false>
(name="lib64/libLLVMAArch64CodeGen.a(AArch64AsmPrinter.cpp.o)",
input_file=0x3aa4560, offset=266628, ehdr=..., punconfigured=0x0) at
../../binutils/gold/object.cc:3118
#10 0x0000000001007515 in gold::make_elf_object
(name="lib64/libLLVMAArch64CodeGen.a(AArch64AsmPrinter.cpp.o)",
input_file=0x3aa4560, offset=266628, p=0x3abef38
"\177ELF\002\001\001\003", bytes=64, punconfigured=0x0) at
../../binutils/gold/object.cc:3242
#11 0x0000000000cfa13e in gold::Archive::get_elf_object_for_member
(this=0x3aa4660, off=266568, punconfigured=0x0) at
../../binutils/gold/archive.cc:674

Oops, that looks like a bug in nacl.h: the Sniff_file class calls
get_view(0, file_offset, ...) instead of get_view(file_offset, 0,
...). That will only get a view that's aligned for offset 0, rather
than a view that's aligned at file_offset.

-cary


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