From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id BDDD6385781F for ; Wed, 11 Jan 2023 16:28:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BDDD6385781F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1673454505; x=1704990505; h=from:to:in-reply-to:subject:mime-version: content-transfer-encoding:references:message-id:date; bh=CLEX/PFDb0ZT5rREHcUGdhEw9OL8LWKQeu5AN7LxO+k=; b=KXqZGmOdnyGhWxa5MJAIGQk0XfgvRjNcgshpsRQRPfJz7L0eHxaNrB9c wdMwvrbLkKkUaqcbwkPcQnlCs19rZGpSyGr6JQKz291RPZeJEqFs67eln P7Dw6aub0qBOGX2AZynyClmzYftmciEl/cZl2WxeUEnVr19bZQTUPJ0wj YfhAu+HHotG6FpM6HruA9gDwoRJW63aCtPVl4eHr68IZniabgtCxa7xiG Jzn1d2ixvGfkSGGJBpJreVUvkjCGIgeImVnacUxUKe4aNYaTYOQAE+XBz zWAEgOKkixd9f7FrQX5ivFPqIMop2jY5jy/0Gj/MTnVPmzFZDmR40In7d Q==; From: Hans-Peter Nilsson To: , , , In-Reply-To: <20230103151629.8263320430@pchp3.se.axis.com> (message from Hans-Peter Nilsson on Tue, 3 Jan 2023 16:16:29 +0100) Subject: Re: ARM: Fix ld bloat introduced between binutils-2.38 and 2.39 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT References: <20230102160857.ABA7F2042C@pchp3.se.axis.com> <20230103024119.12F182042C@pchp3.se.axis.com> <20230103151629.8263320430@pchp3.se.axis.com> Message-ID: <20230111162823.7AF1A20434@pchp3.se.axis.com> Date: Wed, 11 Jan 2023 17:28:23 +0100 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: To be committed before the ELF_MAXPAGESIZE 0x1000 fix, wherever (and if ever) that one's approved. Ok as above? ---- 8< ---- Subject: ld/testsuite: Adjust for ELF_MAXPAGESIZE 0x1000 Many tests reflect a setting of ELF_MAXPAGESIZE to 64 KiB. With ELF_MAXPAGESIZE changed to 4 KiB, layout is sometimes different and symbols end up in other places. Avoid churn and regexpification of old test patterns by passing the max-page-size setting active at the time. ld/testsuite: * testsuite/ld-arm/arm-elf.exp, testsuite/ld-arm/non-contiguous-arm2.d, testsuite/ld-arm/non-contiguous-arm3.d, testsuite/ld-arm/non-contiguous-arm5.d, testsuite/ld-arm/non-contiguous-arm6.d, testsuite/ld-arm/thumb-plt-got.d, testsuite/ld-arm/thumb-plt.d: Pass -z max-page-size=0x10000 explicitly to test that rely on that value in output-matching patterns. --- ld/testsuite/ld-arm/arm-elf.exp | 49 ++++++++++++----------- ld/testsuite/ld-arm/non-contiguous-arm2.d | 2 +- ld/testsuite/ld-arm/non-contiguous-arm3.d | 2 +- ld/testsuite/ld-arm/non-contiguous-arm5.d | 2 +- ld/testsuite/ld-arm/non-contiguous-arm6.d | 2 +- ld/testsuite/ld-arm/thumb-plt-got.d | 2 +- ld/testsuite/ld-arm/thumb-plt.d | 2 +- 7 files changed, 32 insertions(+), 29 deletions(-) diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index 747155fc8168..9c8056478cec 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -640,7 +640,9 @@ set armeabitests_nonacl { {"Multiple farcalls" "-Ttext 0x1000 --section-start .foo=0x2002020" "" "" {farcall-mix.s} {{objdump -d farcall-mix.d}} "farcall-mix"} - {"Multiple farcalls from several sections" "-Ttext 0x1000 --section-start .mytext=0x2000 --section-start .foo=0x2003020" "" "" {farcall-mix2.s} + {"Multiple farcalls from several sections" + "-Ttext 0x1000 --section-start .mytext=0x2000 --section-start .foo=0x2003020 -z max-page-size=0x10000" + "" "" {farcall-mix2.s} {{objdump -d farcall-mix2.d}} "farcall-mix2"} @@ -738,7 +740,7 @@ set armeabitests_nonacl { {{ld cmse-veneers-wrong-entryfct.out}} "cmse-veneers-wrong-entryfct"} {"Secure gateway veneers (ARMv8-M Baseline)" - "-Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --gc-sections" "" + "-Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --gc-sections -z max-page-size=0x10000" "" "-march=armv8-m.base -mthumb" {cmse-veneers.s} {{objdump {-d -j .gnu.sgstubs} cmse-veneers.d} @@ -746,7 +748,7 @@ set armeabitests_nonacl { {nm {} cmse-veneers.rd}} "cmse-veneers-baseline"} {"Secure gateway veneers (ARMv8-M Mainline)" - "-Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --gc-sections" "" + "-Ttext=0x8000 --section-start .gnu.sgstubs=0x20000 --gc-sections -z max-page-size=0x10000" "" "-march=armv8-m.main -mthumb" {cmse-veneers.s} {{objdump {-d -j .gnu.sgstubs} cmse-veneers.d} @@ -909,32 +911,32 @@ set armeabitests_nonacl { "-EL -Ttext=0x8f00 --fix-cortex-a8" "" "-EL" {cortex-a8-fix-blx-bcond.s} {{objdump -dr cortex-a8-fix-blx-bcond.d}} "cortex-a8-fix-blx-bcond"} - {"IFUNC test 1" "-T ifunc-static.ld" "" "" {ifunc-1.s} + {"IFUNC test 1" "-T ifunc-static.ld -z max-page-size=0x10000" "" "" {ifunc-1.s} {{objdump -d ifunc-1.dd} {objdump {-s -j.data -j.got} ifunc-1.gd} {readelf -dr ifunc-1.rd}} "ifunc-1"} - {"IFUNC test 2" "-T ifunc-static.ld" "" "" {ifunc-2.s} + {"IFUNC test 2" "-T ifunc-static.ld -z max-page-size=0x10000" "" "" {ifunc-2.s} {{objdump -d ifunc-2.dd} {objdump {-s -j.data -j.got} ifunc-2.gd} {readelf -dr ifunc-2.rd}} "ifunc-2"} - {"IFUNC test 5" "-T ifunc-static.ld" "" "" {ifunc-5.s} + {"IFUNC test 5" "-T ifunc-static.ld -z max-page-size=0x10000" "" "" {ifunc-5.s} {{objdump -d ifunc-5.dd} {objdump {-s -j.data -j.got} ifunc-5.gd} {readelf -dr ifunc-5.rd}} "ifunc-5"} - {"IFUNC test 6" "-T ifunc-static.ld" "" "" {ifunc-6.s} + {"IFUNC test 6" "-T ifunc-static.ld -z max-page-size=0x10000" "" "" {ifunc-6.s} {{objdump -d ifunc-6.dd} {objdump {-s -j.data -j.got} ifunc-6.gd} {readelf -dr ifunc-6.rd}} "ifunc-6"} - {"IFUNC test 11" "-T ifunc-static.ld" "" "" {ifunc-11.s} + {"IFUNC test 11" "-T ifunc-static.ld -z max-page-size=0x10000" "" "" {ifunc-11.s} {{objdump -d ifunc-11.dd} {objdump {-s -j.data -j.got} ifunc-11.gd} {readelf -dr ifunc-11.rd}} "ifunc-11"} - {"IFUNC test 17" "-T ifunc-static.ld" "" "" {ifunc-17.s} + {"IFUNC test 17" "-T ifunc-static.ld -z max-page-size=0x10000" "" "" {ifunc-17.s} {{objdump -d ifunc-17.dd} {objdump {-s -j.data -j.got} ifunc-17.gd} {readelf -r ifunc-17.rd}} @@ -1007,7 +1009,7 @@ set armeabitests_nonacl_shared { "farcall-mixed-lib.so"} {"Cortex-A8 erratum fix, b.w to PLT" - "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared" "" "-EL" + "-EL -Tcortex-a8-fix-plt.ld --fix-cortex-a8 -shared -z max-page-size=0x10000" "" "-EL" {cortex-a8-fix-b-plt.s} {{objdump -dr cortex-a8-fix-b-plt.d}} "cortex-a8-fix-b-plt"} @@ -1027,65 +1029,66 @@ set armeabitests_nonacl_shared { {{objdump -dr cortex-a8-fix-blx-plt.d}} "cortex-a8-fix-blx-plt"} {"Cortex-A8 erratum fix, relocate bl.w to PLT" - "-EL --section-start=.plt=0x8e00 -Ttext=0x8f00 --fix-cortex-a8 -shared --hash-style=sysv" "" + "-EL --section-start=.plt=0x8e00 -Ttext=0x8f00 --fix-cortex-a8 -shared --hash-style=sysv -z max-page-size=0x10000" + "" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s} {{objdump -dr cortex-a8-fix-bl-rel-plt.d}} "cortex-a8-fix-bl-rel-thumb"} - {"IFUNC test 3" "-T ifunc-dynamic.ld -shared" "" "" {ifunc-3.s} + {"IFUNC test 3" "-T ifunc-dynamic.ld -shared -z max-page-size=0x10000" "" "" {ifunc-3.s} {{objdump -d ifunc-3.dd} {objdump {-s -j.data -j.got} ifunc-3.gd} {readelf -r ifunc-3.rd}} "ifunc-3.so"} - {"IFUNC test 4" "-T ifunc-dynamic.ld -shared" "" "" {ifunc-4.s} + {"IFUNC test 4" "-T ifunc-dynamic.ld -shared -z max-page-size=0x10000" "" "" {ifunc-4.s} {{objdump -d ifunc-4.dd} {objdump {-s -j.data -j.got} ifunc-4.gd} {readelf -r ifunc-4.rd}} "ifunc-4.so"} - {"IFUNC test 7" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so -shared" "" + {"IFUNC test 7" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so -shared -z max-page-size=0x10000" "" "" {ifunc-7.s} {{objdump -d ifunc-7.dd} {objdump {-s -j.data -j.got} ifunc-7.gd} {readelf -r ifunc-7.rd}} "ifunc-7.so"} - {"IFUNC test 12" "-T ifunc-dynamic.ld -shared" "" "" {ifunc-12.s} + {"IFUNC test 12" "-T ifunc-dynamic.ld -shared -z max-page-size=0x10000" "" "" {ifunc-12.s} {{objdump -d ifunc-12.dd} {objdump {-s -j.data -j.got} ifunc-12.gd} {readelf -r ifunc-12.rd}} "ifunc-12.so"} - {"IFUNC test 9" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so" "" "" {ifunc-9.s} + {"IFUNC test 9" "-T ifunc-dynamic.ld tmpdir/ifunc-3.so -z max-page-size=0x10000" "" "" {ifunc-9.s} {{objdump -d ifunc-9.dd} {objdump {-s -j.data -j.got} ifunc-9.gd} {readelf -r ifunc-9.rd}} "ifunc-9"} - {"IFUNC test 10" "-T ifunc-dynamic.ld tmpdir/ifunc-4.so" "" "" {ifunc-10.s} + {"IFUNC test 10" "-T ifunc-dynamic.ld tmpdir/ifunc-4.so -z max-page-size=0x10000" "" "" {ifunc-10.s} {{objdump -d ifunc-10.dd} {objdump {-s -j.data -j.got} ifunc-10.gd} {readelf -r ifunc-10.rd}} "ifunc-10"} - {"IFUNC test 13" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" "" {ifunc-13.s} + {"IFUNC test 13" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so -z max-page-size=0x10000" "" "" {ifunc-13.s} {{objdump -d ifunc-13.dd} {objdump {-s -j.data -j.got} ifunc-13.gd} {readelf -r ifunc-13.rd}} "ifunc-13"} - {"IFUNC test 14" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" "" {ifunc-14.s} + {"IFUNC test 14" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so -z max-page-size=0x10000" "" "" {ifunc-14.s} {{objdump -d ifunc-14.dd} {objdump {-s -j.data -j.got} ifunc-14.gd} {readelf -r ifunc-14.rd}} "ifunc-14"} - {"IFUNC test 15" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" "" {ifunc-15.s} + {"IFUNC test 15" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so -z max-page-size=0x10000" "" "" {ifunc-15.s} {{objdump -d ifunc-15.dd} {objdump {-s -j.data -j.got} ifunc-15.gd} {readelf -r ifunc-15.rd}} "ifunc-15"} - {"IFUNC test 16" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so" "" "" {ifunc-16.s} + {"IFUNC test 16" "-T ifunc-dynamic.ld tmpdir/ifunc-12.so -z max-page-size=0x10000" "" "" {ifunc-16.s} {{objdump -d ifunc-16.dd} {objdump {-s -j.data -j.got} ifunc-16.gd} {readelf -r ifunc-16.rd}} "ifunc-16"} - {"Long PLT entries in executables" "--long-plt -shared --section-start=.plt=0x1000 --section-start=.got=0xf0001100" "" - "" {long-plt-format.s} + {"Long PLT entries in executables" + "--long-plt -shared --section-start=.plt=0x1000 --section-start=.got=0xf0001100" "" "" {long-plt-format.s} {{objdump "-d -j .plt" long-plt-format.d}} "long-plt-format"} diff --git a/ld/testsuite/ld-arm/non-contiguous-arm2.d b/ld/testsuite/ld-arm/non-contiguous-arm2.d index 811230c212b8..ed738bcd09c9 100644 --- a/ld/testsuite/ld-arm/non-contiguous-arm2.d +++ b/ld/testsuite/ld-arm/non-contiguous-arm2.d @@ -1,6 +1,6 @@ #name: non-contiguous-arm2 #source: non-contiguous-arm.s -#ld: --enable-non-contiguous-regions -T non-contiguous-arm2.ld +#ld: --enable-non-contiguous-regions -T non-contiguous-arm2.ld -z max-page-size=0x10000 #objdump: -rdth #xfail: [is_generic] diff --git a/ld/testsuite/ld-arm/non-contiguous-arm3.d b/ld/testsuite/ld-arm/non-contiguous-arm3.d index 9d5bc5649625..2912f35d0f7b 100644 --- a/ld/testsuite/ld-arm/non-contiguous-arm3.d +++ b/ld/testsuite/ld-arm/non-contiguous-arm3.d @@ -1,6 +1,6 @@ #name: non-contiguous-arm3 #source: non-contiguous-arm.s -#ld: --enable-non-contiguous-regions -T non-contiguous-arm3.ld +#ld: --enable-non-contiguous-regions -T non-contiguous-arm3.ld -z max-page-size=0x10000 #objdump: -rdth #xfail: [is_generic] #skip: arm*nacl diff --git a/ld/testsuite/ld-arm/non-contiguous-arm5.d b/ld/testsuite/ld-arm/non-contiguous-arm5.d index 730df2fc5475..f41f50afd0b6 100644 --- a/ld/testsuite/ld-arm/non-contiguous-arm5.d +++ b/ld/testsuite/ld-arm/non-contiguous-arm5.d @@ -1,6 +1,6 @@ #name: non-contiguous-arm5 #source: non-contiguous-arm.s -#ld: --enable-non-contiguous-regions -T non-contiguous-arm5.ld +#ld: --enable-non-contiguous-regions -T non-contiguous-arm5.ld -z max-page-size=0x10000 #objdump: -rdth #xfail: [is_generic] diff --git a/ld/testsuite/ld-arm/non-contiguous-arm6.d b/ld/testsuite/ld-arm/non-contiguous-arm6.d index 9a9869caf3f5..3d737f0905e9 100644 --- a/ld/testsuite/ld-arm/non-contiguous-arm6.d +++ b/ld/testsuite/ld-arm/non-contiguous-arm6.d @@ -1,6 +1,6 @@ #name: non-contiguous-arm6 #source: non-contiguous-arm.s -#ld: --enable-non-contiguous-regions -T non-contiguous-arm6.ld +#ld: --enable-non-contiguous-regions -T non-contiguous-arm6.ld -z max-page-size=0x10000 #objdump: -rdth #xfail: [is_generic] #skip: arm*nacl diff --git a/ld/testsuite/ld-arm/thumb-plt-got.d b/ld/testsuite/ld-arm/thumb-plt-got.d index 370a4e2c6033..5cebae23d453 100644 --- a/ld/testsuite/ld-arm/thumb-plt-got.d +++ b/ld/testsuite/ld-arm/thumb-plt-got.d @@ -1,6 +1,6 @@ #source: thumb-plt.s #name: Thumb only PLT and GOT LSB Symbol -#ld: -shared -e0 +#ld: -shared -e0 -z max-page-size=0x10000 #readelf: -rx .got #skip: *-*-pe *-*-wince *-*-vxworks armeb-*-* *-*-gnueabihf diff --git a/ld/testsuite/ld-arm/thumb-plt.d b/ld/testsuite/ld-arm/thumb-plt.d index 606b67e26e08..596c8a949dfe 100644 --- a/ld/testsuite/ld-arm/thumb-plt.d +++ b/ld/testsuite/ld-arm/thumb-plt.d @@ -1,6 +1,6 @@ #source: thumb-plt.s #name: Thumb only PLT and GOT -#ld: -shared -e0 +#ld: -shared -e0 -z max-page-size=0x10000 #objdump: -dr #skip: *-*-pe *-*-wince *-*-vxworks armeb-*-* *-*-gnueabihf -- 2.30.2