It's a difference in memory model.
clang 6.0.0 under ubuntu with --target=x86_64-pc-cygwin gives relative
addresses, unless you specify -mcmodel=large.
Cygwin clang with -mcmodel=small does the right thing: use relative
addresses.
The -mcmodel=small option appears to work differently for
References: <578eb489-9391-9009-82ad-676eeb4c1...@agner.org>
In-Reply-To: <578eb489-9391-9009-82ad-676eeb4c1...@agner.org>
Could the different behaviour between Cygwin and Linux simply be due to
different Clang versions?
The current version under Cygwin is 5.0.1, while the latest version
Agner Fog wrote:
Clang is using 64-bit absolute addresses when accessing static data in 64-bit
mode. This is inefficient because it requires an extra 10-bytes long instruction
for loading an address into a register every time it needs to access static
data. All other compilers use relative
Clang is using 64-bit absolute addresses when accessing static data in
64-bit mode. This is inefficient because it requires an extra 10-bytes
long instruction for loading an address into a register every time it
needs to access static data. All other compilers use relative addresses.
Example:
4 matches
Mail list logo