Re: [PATCH v2 5/7] configure: Unnest detection of -z, relro and -z, now

2019-12-18 Thread Fangrui Song
-Daudé One nit, .got is also read-only in partial relro. Full relro makes .got.plt read-only. (On EM_PPC and EM_PPC64, .got.plt is named .plt (yes, misnomer)). Reviewed-by: Fangrui Song

Re: [PATCH 0/7] configure: Improve PIE and other linkage

2019-12-17 Thread Fangrui Song
On 2019-12-17, Richard Henderson wrote: This begins by dropping the -Ttext-segment stuff, which Fangrui Song correctly points out does not work with lld. But it's also obsolete, so instead of adding support for lld's --image-base, remove it all. Then, remove some other legacy random

Re: [PATCH] configure: Use lld --image-base for --disable-pie user mode binaries

2019-12-16 Thread Fangrui Song
On 2019-12-09, Fangrui Song wrote: On 2019-12-01, Fangrui Song wrote: Thanks for reviewing this patch! On 2019-12-01, Richard Henderson wrote: On 11/27/19 6:36 PM, Fangrui Song wrote: On 2019-11-20, Fangrui Song wrote: On 2019-11-15, Fangrui Song wrote: For lld, --image-base is the

Re: [PATCH] configure: Use lld --image-base for --disable-pie user mode binaries

2019-12-09 Thread Fangrui Song
On 2019-12-01, Fangrui Song wrote: Thanks for reviewing this patch! On 2019-12-01, Richard Henderson wrote: On 11/27/19 6:36 PM, Fangrui Song wrote: On 2019-11-20, Fangrui Song wrote: On 2019-11-15, Fangrui Song wrote: For lld, --image-base is the preferred way to set the base address. lld

Re: [PATCH] configure: Use lld --image-base for --disable-pie user mode binaries

2019-12-01 Thread Fangrui Song
Thanks for reviewing this patch! On 2019-12-01, Richard Henderson wrote: On 11/27/19 6:36 PM, Fangrui Song wrote: On 2019-11-20, Fangrui Song wrote: On 2019-11-15, Fangrui Song wrote: For lld, --image-base is the preferred way to set the base address. lld does not actually implement -Ttext

[PATCH v2] configure: Use lld --image-base for --disable-pie user mode binaries

2019-11-29 Thread Fangrui Song
On 2019-11-27, Alex Bennée wrote: Fangrui Song writes: For lld, --image-base is the preferred way to set the base address. lld does not actually implement -Ttext-segment, but treats it as an alias for -Ttext. -Ttext-segment=0x6000 combined with --no-rosegment can create a 1.6GB

Re: [PATCH] configure: Use lld --image-base for --disable-pie user mode binaries

2019-11-27 Thread Fangrui Song
On 2019-11-20, Fangrui Song wrote: On 2019-11-15, Fangrui Song wrote: For lld, --image-base is the preferred way to set the base address. lld does not actually implement -Ttext-segment, but treats it as an alias for -Ttext. -Ttext-segment=0x6000 combined with --no-rosegment can create a

[PATCH v2] Fix incorrect integer->float conversions caught by clang -Wimplicit-int-float-conversion

2019-11-21 Thread Fangrui Song
On 2019-11-21, Eric Blake wrote: On 11/19/19 2:49 PM, Fangrui Song wrote: Can we simply drop the offending line statement instead? Fixed in the new patch. The first val * mul above this range is 0x1p64.  Rejecting it is correct, because it overflows yint64_t. I am not subscribed, so

Re: [PATCH] Fix incorrect int->float conversions caught by clang -Wimplicit-int-float-conversion

2019-11-21 Thread Fangrui Song
On 2019-11-21, Markus Armbruster wrote: Richard Henderson writes: On 11/20/19 6:30 PM, Fangrui Song wrote: On 2019-11-20, Juan Quintela wrote: Markus Armbruster wrote: Fangrui Song writes: [...] diff --git a/util/cutils.c b/util/cutils.c index fd591cadf0..2b4484c015 100644 --- a/util

Re: [PATCH] configure: Use lld --image-base for --disable-pie user mode binaries

2019-11-20 Thread Fangrui Song
On 2019-11-15, Fangrui Song wrote: For lld, --image-base is the preferred way to set the base address. lld does not actually implement -Ttext-segment, but treats it as an alias for -Ttext. -Ttext-segment=0x6000 combined with --no-rosegment can create a 1.6GB executable. Fix the problem by

Re: [PATCH] Fix incorrect int->float conversions caught by clang -Wimplicit-int-float-conversion

2019-11-20 Thread Fangrui Song
On 2019-11-20, Juan Quintela wrote: Markus Armbruster wrote: Fangrui Song writes: The warning will be enabled by default in clang 10. It is not available for clang <= 9. qemu/migration/migration.c:2038:24: error: implicit conversion from 'long' to 'double&#

Re: [PATCH] Fix incorrect int->float conversions caught by clang -Wimplicit-int-float-conversion

2019-11-19 Thread Fangrui Song
Fangrui Song writes: > The warning will be enabled by default in clang 10. It is not available for > clang <= 9. > > qemu/migration/migration.c:2038:24: error: implicit conversion from 'long' to > 'double' changes value from 9223372036854775807 to 9223

[PATCH] configure: Use lld --image-base for --disable-pie user mode binaries

2019-11-15 Thread Fangrui Song
gold will still get -Ttext-segment. Also delete the ld --verbose fallback introduced in 2013, which is no longer relevant or correct (the default linker script has changed). Signed-off-by: Fangrui Song --- configure | 33 - 1 file changed, 12 insertions(+), 21

[PATCH] Fix incorrect int->float conversions caught by clang -Wimplicit-int-float-conversion

2019-11-15 Thread Fangrui Song
nversion] ... qemu/util/cutils.c:245:23: error: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709550592 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion] Signed-off-by: Fangrui Song --- migration/migration.c | 4 ++--