From fe76210da68d02f3b23562a5d5d6ca3a24236098 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 3 Jun 2021 22:14:54 +0900 Subject: [PATCH] Change the default build-id size from 20 to 16 bytes GNU ld's default build-id size is 16. --- cmdline.cc | 2 +- test/build-id.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmdline.cc b/cmdline.cc index 10d6b8da..e3dab910 100644 --- a/cmdline.cc +++ b/cmdline.cc @@ -647,7 +647,7 @@ void parse_nonpositional_args(Context &ctx, ctx.arg.rpaths += arg; } else if (read_flag(args, "build-id")) { ctx.arg.build_id.kind = BuildId::HASH; - ctx.arg.build_id.hash_size = 20; + ctx.arg.build_id.hash_size = 16; } else if (read_arg(ctx, args, arg, "build-id")) { if (arg == "none") { ctx.arg.build_id.kind = BuildId::NONE; diff --git a/test/build-id.sh b/test/build-id.sh index 61d7adbb..86427b0b 100755 --- a/test/build-id.sh +++ b/test/build-id.sh @@ -8,7 +8,7 @@ mkdir -p $t echo 'int main() { return 0; }' > $t/a.c clang -o $t/exe $t/a.c -fuse-ld=`pwd`/../mold -Wl,-build-id -readelf -n $t/exe | grep -qv 'GNU.*0x00000010.*NT_GNU_BUILD_ID' +readelf -n $t/exe | grep -q 'GNU.*0x00000010.*NT_GNU_BUILD_ID' clang -o $t/exe $t/a.c -fuse-ld=`pwd`/../mold -Wl,-build-id=uuid readelf -nW $t/exe |