From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 460E038A9435 for ; Tue, 11 Jan 2022 14:06:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 460E038A9435 Received: by mail-pl1-x633.google.com with SMTP id h1so17299036pls.11 for ; Tue, 11 Jan 2022 06:06:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iAyvEiIYX0WPkPfnh3OZwW0toQXiY3ItCzs/vwA3nmw=; b=BNnh1brOGc7yVfDWtSgXkn38Kwfrswch5m/rWsCEFckoJ91Oh2d2pwq7bL9mKeQ/pQ PgvtmYYEqCnQ0v5Sa39Pm/m+Rx2EFU5fYv6ICyNSFdkEb0/bdeEDz7S4CnoQ66b7KxVh ucRtfhw7lzuMVosoxa9pqmXJ4B6L83HlCICKH7Pyyh0WQ3I6ON5iTobZ2Un6WalUWoQr G6YVX4EAGZn81fahWx5tEai1LsoHxHY8pRQzaCvfQnOmn2qbF3vBIWma4cdGnAOHBOyX cZDJ7HuH5BQ+jF6xvX0SW8FA7blKHhrl6yqVk2im5N2dKSTz9Nbq56TGOH7LDGW/Ffbr C2aw== X-Gm-Message-State: AOAM532JvbXAsz7xFEOwsJYouP1tl5kNQAFu6GnA+yNEHFqK7kdjjxpp CD5/OzTL+jeUxO/nXsknFeDnnF8wTbg= X-Google-Smtp-Source: ABdhPJyCPBYQjf7o9p0wdbrTdfbOkcLZVNE4/a9B7v+ToLE52YLQ1cglTWaijpz4Wp5FstgqRX5Uvg== X-Received: by 2002:a17:90a:c254:: with SMTP id d20mr3336715pjx.226.1641909999228; Tue, 11 Jan 2022 06:06:39 -0800 (PST) Received: from gnu-tgl-3.localdomain ([172.58.35.133]) by smtp.gmail.com with ESMTPSA id my5sm3199497pjb.5.2022.01.11.06.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 06:06:37 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 8B67BC09C5; Tue, 11 Jan 2022 06:06:34 -0800 (PST) From: "H.J. Lu" To: binutils@sourceware.org Subject: [PATCH v3 8/9] ld: Add simple DT_RELR tests Date: Tue, 11 Jan 2022 06:06:33 -0800 Message-Id: <20220111140634.2250914-9-hjl.tools@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220111140634.2250914-1-hjl.tools@gmail.com> References: <20220111140634.2250914-1-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3028.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2022 14:06:43 -0000 * testsuite/ld-elf/dt-relr-1.s: New file. * testsuite/ld-elf/dt-relr-1a.d: Likewise. * testsuite/ld-elf/dt-relr-1b.d: Likewise. * testsuite/ld-elf/dt-relr-1c.d: Likewise. * testsuite/ld-elf/dt-relr-2.s: Likewise. * testsuite/ld-elf/dt-relr-2a.d: Likewise. * testsuite/ld-elf/dt-relr-2b.d: Likewise. * testsuite/ld-elf/dt-relr-2c.d: Likewise. * testsuite/ld-elf/dt-relr-2d.d: Likewise. * testsuite/ld-elf/dt-relr-2e.d: Likewise. * testsuite/ld-elf/dt-relr-2f.d: Likewise. * testsuite/ld-elf/dt-relr-2g.d: Likewise. * testsuite/ld-elf/dt-relr-2h.d: Likewise. * testsuite/ld-elf/dt-relr-3.s: Likewise. * testsuite/ld-elf/dt-relr-3a.d: Likewise. * testsuite/ld-elf/dt-relr-3b.d: Likewise. * testsuite/ld-i386/dt-relr-1.d: Likewise. * testsuite/ld-i386/dt-relr-1.s: Likewise. * testsuite/ld-x86-64/dt-relr-1-x32.d: Likewise. * testsuite/ld-x86-64/dt-relr-1.d: Likewise. * testsuite/ld-x86-64/dt-relr-1.s: Likewise. * testsuite/ld-i386/i386.exp: Run dt-relr-1. * testsuite/ld-x86-64/x86-64.exp: Run dt-relr-1 and dt-relr-1-x32. --- ld/testsuite/ld-elf/dt-relr-1.s | 13 +++++++++++++ ld/testsuite/ld-elf/dt-relr-1a.d | 10 ++++++++++ ld/testsuite/ld-elf/dt-relr-1b.d | 9 +++++++++ ld/testsuite/ld-elf/dt-relr-1c.d | 9 +++++++++ ld/testsuite/ld-elf/dt-relr-2.s | 20 ++++++++++++++++++++ ld/testsuite/ld-elf/dt-relr-2a.d | 10 ++++++++++ ld/testsuite/ld-elf/dt-relr-2b.d | 17 +++++++++++++++++ ld/testsuite/ld-elf/dt-relr-2c.d | 17 +++++++++++++++++ ld/testsuite/ld-elf/dt-relr-2d.d | 17 +++++++++++++++++ ld/testsuite/ld-elf/dt-relr-2e.d | 9 +++++++++ ld/testsuite/ld-elf/dt-relr-2f.d | 8 ++++++++ ld/testsuite/ld-elf/dt-relr-2g.d | 9 +++++++++ ld/testsuite/ld-elf/dt-relr-2h.d | 9 +++++++++ ld/testsuite/ld-elf/dt-relr-3.s | 12 ++++++++++++ ld/testsuite/ld-elf/dt-relr-3a.d | 9 +++++++++ ld/testsuite/ld-elf/dt-relr-3b.d | 9 +++++++++ ld/testsuite/ld-i386/dt-relr-1.d | 15 +++++++++++++++ ld/testsuite/ld-i386/dt-relr-1.s | 3 +++ ld/testsuite/ld-i386/i386.exp | 1 + ld/testsuite/ld-x86-64/dt-relr-1-x32.d | 16 ++++++++++++++++ ld/testsuite/ld-x86-64/dt-relr-1.d | 15 +++++++++++++++ ld/testsuite/ld-x86-64/dt-relr-1.s | 3 +++ ld/testsuite/ld-x86-64/x86-64.exp | 2 ++ 23 files changed, 242 insertions(+) create mode 100644 ld/testsuite/ld-elf/dt-relr-1.s create mode 100644 ld/testsuite/ld-elf/dt-relr-1a.d create mode 100644 ld/testsuite/ld-elf/dt-relr-1b.d create mode 100644 ld/testsuite/ld-elf/dt-relr-1c.d create mode 100644 ld/testsuite/ld-elf/dt-relr-2.s create mode 100644 ld/testsuite/ld-elf/dt-relr-2a.d create mode 100644 ld/testsuite/ld-elf/dt-relr-2b.d create mode 100644 ld/testsuite/ld-elf/dt-relr-2c.d create mode 100644 ld/testsuite/ld-elf/dt-relr-2d.d create mode 100644 ld/testsuite/ld-elf/dt-relr-2e.d create mode 100644 ld/testsuite/ld-elf/dt-relr-2f.d create mode 100644 ld/testsuite/ld-elf/dt-relr-2g.d create mode 100644 ld/testsuite/ld-elf/dt-relr-2h.d create mode 100644 ld/testsuite/ld-elf/dt-relr-3.s create mode 100644 ld/testsuite/ld-elf/dt-relr-3a.d create mode 100644 ld/testsuite/ld-elf/dt-relr-3b.d create mode 100644 ld/testsuite/ld-i386/dt-relr-1.d create mode 100644 ld/testsuite/ld-i386/dt-relr-1.s create mode 100644 ld/testsuite/ld-x86-64/dt-relr-1-x32.d create mode 100644 ld/testsuite/ld-x86-64/dt-relr-1.d create mode 100644 ld/testsuite/ld-x86-64/dt-relr-1.s diff --git a/ld/testsuite/ld-elf/dt-relr-1.s b/ld/testsuite/ld-elf/dt-relr-1.s new file mode 100644 index 00000000000..1eb34588160 --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-1.s @@ -0,0 +1,13 @@ + .text + .p2align 3 + .globl _start +_start: + .byte 0 + + .data + .p2align 3 + .globl data +data: + .byte 0 + // Offset is not a multiple of 2. Don't use DT_RELR. + .dc.a __ehdr_start + 10 diff --git a/ld/testsuite/ld-elf/dt-relr-1a.d b/ld/testsuite/ld-elf/dt-relr-1a.d new file mode 100644 index 00000000000..55c93cefb59 --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-1a.d @@ -0,0 +1,10 @@ +#source: dt-relr-1.s +#ld: -e _start $DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#... +There is no dynamic section in this file. +#... +There are no relocations in this file. +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-1b.d b/ld/testsuite/ld-elf/dt-relr-1b.d new file mode 100644 index 00000000000..2b78f75d378 --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-1b.d @@ -0,0 +1,9 @@ +#source: dt-relr-1.s +#ld: -e _start -pie $DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#failif +#... +Relocation section '\.relr\.dyn' at offset .* +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-1c.d b/ld/testsuite/ld-elf/dt-relr-1c.d new file mode 100644 index 00000000000..14f6cda6832 --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-1c.d @@ -0,0 +1,9 @@ +#source: dt-relr-1.s +#ld: -shared $DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#failif +#... +Relocation section '\.relr\.dyn' at offset .* +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-2.s b/ld/testsuite/ld-elf/dt-relr-2.s new file mode 100644 index 00000000000..bd1f3dfa16f --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-2.s @@ -0,0 +1,20 @@ + .text + .p2align 3 + .globl _start +_start: + .byte 0 + + .data + .p2align 3 + .globl data +data: + + .dc.a .data + .dc.a 0 + .dc.a data + 2 + .dc.a __ehdr_start + 4 + .dc.a __ehdr_start + 9 + + .byte 0 + // Offset is not a multiple of 2. Don't use DT_RELR. + .dc.a __ehdr_start + 10 diff --git a/ld/testsuite/ld-elf/dt-relr-2a.d b/ld/testsuite/ld-elf/dt-relr-2a.d new file mode 100644 index 00000000000..31ef9e8e80e --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-2a.d @@ -0,0 +1,10 @@ +#source: dt-relr-2.s +#ld: -e _start $DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#... +There is no dynamic section in this file. +#... +There are no relocations in this file. +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-2b.d b/ld/testsuite/ld-elf/dt-relr-2b.d new file mode 100644 index 00000000000..7c401732a56 --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-2b.d @@ -0,0 +1,17 @@ +#source: dt-relr-2.s +#ld: -e _start -pie $DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#... + 0x[0-9a-f]+ \(RELR\) +0x[0-9a-f]+ + 0x[0-9a-f]+ \(RELRSZ\) +(8|16) \(bytes\) + 0x[0-9a-f]+ \(RELRENT\) +(4|8) \(bytes\) +#... +Relocation section '\.rel(a|)\.dyn' at offset 0x[0-9a-f]+ contains 1 entry: +#... +[0-9a-f]+ +[0-9a-f]+ +R_.*_RELATIVE .* +#... +Relocation section '\.relr\.dyn' at offset 0x[0-9a-f]+ contains 2 entries: + 4 offsets +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-2c.d b/ld/testsuite/ld-elf/dt-relr-2c.d new file mode 100644 index 00000000000..63877b2f90f --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-2c.d @@ -0,0 +1,17 @@ +#source: dt-relr-2.s +#ld: -shared $DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#... + 0x[0-9a-f]+ \(RELR\) +0x[0-9a-f]+ + 0x[0-9a-f]+ \(RELRSZ\) +(8|16) \(bytes\) + 0x[0-9a-f]+ \(RELRENT\) +(4|8) \(bytes\) +#... +Relocation section '\.rel(a|)\.dyn' at offset 0x[0-9a-f]+ contains 2 entries: +#... +[0-9a-f]+ +[0-9a-f]+ +R_.*_RELATIVE .* +#... +Relocation section '\.relr\.dyn' at offset 0x[0-9a-f]+ contains 2 entries: + 3 offsets +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-2d.d b/ld/testsuite/ld-elf/dt-relr-2d.d new file mode 100644 index 00000000000..e11528f395c --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-2d.d @@ -0,0 +1,17 @@ +#source: dt-relr-2.s +#ld: -e _start -pie $DT_RELR_LDFLAGS --no-relax +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#... + 0x[0-9a-f]+ \(RELR\) +0x[0-9a-f]+ + 0x[0-9a-f]+ \(RELRSZ\) +(8|16) \(bytes\) + 0x[0-9a-f]+ \(RELRENT\) +(4|8) \(bytes\) +#... +Relocation section '\.rel(a|)\.dyn' at offset 0x[0-9a-f]+ contains 1 entry: +#... +[0-9a-f]+ +[0-9a-f]+ +R_.*_RELATIVE .* +#... +Relocation section '\.relr\.dyn' at offset 0x[0-9a-f]+ contains 2 entries: + 4 offsets +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-2e.d b/ld/testsuite/ld-elf/dt-relr-2e.d new file mode 100644 index 00000000000..79ea62b096a --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-2e.d @@ -0,0 +1,9 @@ +#source: dt-relr-2.s +#ld: -e _start -pie $DT_RELR_LDFLAGS -z nocombreloc +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#failif +#... +Relocation section '\.relr\.dyn' at offset .* +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-2f.d b/ld/testsuite/ld-elf/dt-relr-2f.d new file mode 100644 index 00000000000..4ad592f71fb --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-2f.d @@ -0,0 +1,8 @@ +#source: dt-relr-2.s +#ld: -r $DT_RELR_LDFLAGS +#readelf: -rW +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#... +Relocation section '\.rel(a|)\.data' at offset 0x[0-9a-f]+ contains 5 entries: +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-2g.d b/ld/testsuite/ld-elf/dt-relr-2g.d new file mode 100644 index 00000000000..78e370068af --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-2g.d @@ -0,0 +1,9 @@ +#source: dt-relr-2.s +#ld: -e _start -pie $NO_DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#failif +#... +Relocation section '\.relr\.dyn' at offset .* +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-2h.d b/ld/testsuite/ld-elf/dt-relr-2h.d new file mode 100644 index 00000000000..312373fb179 --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-2h.d @@ -0,0 +1,9 @@ +#source: dt-relr-2.s +#ld: -e _start -shared $NO_DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#failif +#... +Relocation section '\.relr\.dyn' at offset .* +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-3.s b/ld/testsuite/ld-elf/dt-relr-3.s new file mode 100644 index 00000000000..d020132466f --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-3.s @@ -0,0 +1,12 @@ + .text + .p2align 3 + .globl _start +_start: + .byte 0 + + // Section alignment is not a multiple of 2. Don't use DT_RELR. + .data + .p2align 0 + .globl data +data: + .dc.a data diff --git a/ld/testsuite/ld-elf/dt-relr-3a.d b/ld/testsuite/ld-elf/dt-relr-3a.d new file mode 100644 index 00000000000..5a8a014803d --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-3a.d @@ -0,0 +1,9 @@ +#source: dt-relr-3.s +#ld: -e _start -pie $DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#failif +#... +Relocation section '\.relr\.dyn' at offset .* +#pass diff --git a/ld/testsuite/ld-elf/dt-relr-3b.d b/ld/testsuite/ld-elf/dt-relr-3b.d new file mode 100644 index 00000000000..6c38e6968dc --- /dev/null +++ b/ld/testsuite/ld-elf/dt-relr-3b.d @@ -0,0 +1,9 @@ +#source: dt-relr-3.s +#ld: -shared $DT_RELR_LDFLAGS +#readelf: -rW -d +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +#failif +#... +Relocation section '\.relr\.dyn' at offset .* +#pass diff --git a/ld/testsuite/ld-i386/dt-relr-1.d b/ld/testsuite/ld-i386/dt-relr-1.d new file mode 100644 index 00000000000..33eff08ac50 --- /dev/null +++ b/ld/testsuite/ld-i386/dt-relr-1.d @@ -0,0 +1,15 @@ +#as: --32 +#ld: -shared -melf_i386 $DT_RELR_LDFLAGS +#readelf: -r -s --wide +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +Relocation section '.relr.dyn' at offset 0x[a-f0-9]+ contains 1 entry: + +1 offset +[a-f0-9]+ + +#... +Symbol table '.symtab' contains [0-9]+ entries: + Num: Value Size Type Bind Vis Ndx Name +#... + +[a-f0-9]+: 00000000 0 NOTYPE LOCAL DEFAULT 1 __ehdr_start +#pass diff --git a/ld/testsuite/ld-i386/dt-relr-1.s b/ld/testsuite/ld-i386/dt-relr-1.s new file mode 100644 index 00000000000..e492b98e869 --- /dev/null +++ b/ld/testsuite/ld-i386/dt-relr-1.s @@ -0,0 +1,3 @@ + .text +foo: + pushl __ehdr_start@GOT(%ebx) diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index c2d8d8268c3..bbfbf23f63d 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -507,6 +507,7 @@ run_dump_test "pr27491-1c" run_dump_test "pr27491-2" run_dump_test "pr27491-3" run_dump_test "pr27491-4" +run_dump_test "dt-relr-1" if { !([istarget "i?86-*-linux*"] || [istarget "i?86-*-gnu*"] diff --git a/ld/testsuite/ld-x86-64/dt-relr-1-x32.d b/ld/testsuite/ld-x86-64/dt-relr-1-x32.d new file mode 100644 index 00000000000..19a74018a13 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-1-x32.d @@ -0,0 +1,16 @@ +#source: dt-relr-1.s +#as: --x32 +#ld: -shared -melf32_x86_64 $DT_RELR_LDFLAGS +#readelf: -r -s --wide +#target: x86_64-*-linux* + +Relocation section '.relr.dyn' at offset 0x[a-f0-9]+ contains 1 entry: + +1 offset +[a-f0-9]+ + +#... +Symbol table '.symtab' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__ehdr_start +#pass diff --git a/ld/testsuite/ld-x86-64/dt-relr-1.d b/ld/testsuite/ld-x86-64/dt-relr-1.d new file mode 100644 index 00000000000..fdf987ff556 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-1.d @@ -0,0 +1,15 @@ +#as: --64 +#ld: -shared -melf_x86_64 $DT_RELR_LDFLAGS +#readelf: -r -s --wide +#target: x86_64-*-linux* + +Relocation section '.relr.dyn' at offset 0x[a-f0-9]+ contains 1 entry: + +1 offset +[a-f0-9]+ + +#... +Symbol table '.symtab' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +LOCAL +DEFAULT +[0-9]+ +__ehdr_start +#pass diff --git a/ld/testsuite/ld-x86-64/dt-relr-1.s b/ld/testsuite/ld-x86-64/dt-relr-1.s new file mode 100644 index 00000000000..234ec0bf142 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-1.s @@ -0,0 +1,3 @@ + .text +foo: + add __ehdr_start@GOTPCREL(%rip), %rax diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index b4048128057..6a908452af0 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -507,6 +507,8 @@ run_dump_test "pr27491-1c" run_dump_test "pr27491-2" run_dump_test "pr27491-3" run_dump_test "pr27491-4" +run_dump_test "dt-relr-1" +run_dump_test "dt-relr-1-x32" if ![istarget "x86_64-*-linux*"] { return -- 2.34.1