On 10 October 2015 at 12:03, Konstantin Belousov <kostik...@gmail.com> wrote: >> The declaration is extern ostream cout; which correctly has 8 byte alignment. > The alignment of the declaration does not matter, most likely. > I am not sure what you mean by saying that 8 byte alignment is desirable, > while compiler generates accesses (movdqa) which assume 16-byte alignment.
I mean that this object is naturally expected to have 8-byte alignment. In previous versions of libc++.so shipped with FreeBSD it did, and can't be changed now (cout comes from the binary itself, via a copy relocation). >> In the implementation (contrib/libc++/src/iostream.cpp) it is defined >> as a char array which is where the 16-byte ABI alignment would arise, >> but explicitly specifies 8-byte alignment: >> _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)]; >> >> Compiling with -emit-llvm --save-temps shows the desired 8-byte >> alignment for cout in the LLVM IR but 16-byte in the assembly file. > Could somebody show the readelf -s iostream.So and readelf -s libc++.so.X > output lines for the symbol, please ? readelf -s iostream.So: 120: 0000000000000150 160 OBJECT GLOBAL DEFAULT 5 _ZNSt3__14coutE libc++.so.1.full 1280: 00000000002bb4a0 160 OBJECT GLOBAL DEFAULT 25 _ZNSt3__14coutE _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"