From: Nick Clifton Date: Tue, 1 Mar 2022 10:10:20 +0000 (+0000) Subject: Fix linker tests to compile with gcc-12. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=95e96e052ab2d7781a9dc7267123f49c7b1dd671;p=binutils-gdb.git Fix linker tests to compile with gcc-12. PR 21964 * testsuite/ld-elf/pr21964-1a.c: Fix array comparisons. * testsuite/ld-elf/pr21964-1b.c: Likewise. * testsuite/ld-elf/pr21964-1c.c: Likewise. * testsuite/ld-elf/pr21964-2a.c: Likewise. * testsuite/ld-elf/pr21964-2b.c: Likewise. * testsuite/ld-elf/pr21964-3a.c: Likewise. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 3fea7995481..7fb9f5d20b1 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,13 @@ +2022-03-01 Nick Clifton + + PR 21964 + * testsuite/ld-elf/pr21964-1a.c: Fix array comparisons. + * testsuite/ld-elf/pr21964-1b.c: Likewise. + * testsuite/ld-elf/pr21964-1c.c: Likewise. + * testsuite/ld-elf/pr21964-2a.c: Likewise. + * testsuite/ld-elf/pr21964-2b.c: Likewise. + * testsuite/ld-elf/pr21964-3a.c: Likewise. + 2022-02-17 Roland McGrath * ld.texi (Output Section Type): Fix typo in @code syntax. diff --git a/ld/testsuite/ld-elf/pr21964-1a.c b/ld/testsuite/ld-elf/pr21964-1a.c index 680bda4dbfe..a060162ddad 100644 --- a/ld/testsuite/ld-elf/pr21964-1a.c +++ b/ld/testsuite/ld-elf/pr21964-1a.c @@ -4,7 +4,7 @@ int foo1 (void) { static int my_var __attribute__((used, section("__verbose"))) = 5; - if (__start___verbose == __stop___verbose + if (& __start___verbose[0] == & __stop___verbose[0] || __start___verbose[0] != 5) return -1; else diff --git a/ld/testsuite/ld-elf/pr21964-1b.c b/ld/testsuite/ld-elf/pr21964-1b.c index 1507b228088..688bbeb6870 100644 --- a/ld/testsuite/ld-elf/pr21964-1b.c +++ b/ld/testsuite/ld-elf/pr21964-1b.c @@ -4,7 +4,7 @@ int foo2 (void) { static int my_var __attribute__((used, section("__verbose"))) = 10; - if (__start___verbose == __stop___verbose + if (& __start___verbose[0] == & __stop___verbose[0] || __start___verbose[0] != 10) return -1; else diff --git a/ld/testsuite/ld-elf/pr21964-1c.c b/ld/testsuite/ld-elf/pr21964-1c.c index 996a9e182f4..58322bcc227 100644 --- a/ld/testsuite/ld-elf/pr21964-1c.c +++ b/ld/testsuite/ld-elf/pr21964-1c.c @@ -9,7 +9,7 @@ static int my_var __attribute__((used, section("__verbose"))) = 6; int bar (void) { - if (__start___verbose == __stop___verbose) + if (& __start___verbose[0] == & __stop___verbose[0]) return -1; if (__start___verbose[0] != 6) diff --git a/ld/testsuite/ld-elf/pr21964-2a.c b/ld/testsuite/ld-elf/pr21964-2a.c index 6331ff063b9..8b1afca2acc 100644 --- a/ld/testsuite/ld-elf/pr21964-2a.c +++ b/ld/testsuite/ld-elf/pr21964-2a.c @@ -4,7 +4,7 @@ int foo1 (void) { static int my_var __attribute__((used, section("__verbose"))) = 5; - if (__start___verbose == __stop___verbose + if (& __start___verbose[0] == & __stop___verbose[0] && __start___verbose[0] != 5) return -1; else diff --git a/ld/testsuite/ld-elf/pr21964-2b.c b/ld/testsuite/ld-elf/pr21964-2b.c index 1507b228088..688bbeb6870 100644 --- a/ld/testsuite/ld-elf/pr21964-2b.c +++ b/ld/testsuite/ld-elf/pr21964-2b.c @@ -4,7 +4,7 @@ int foo2 (void) { static int my_var __attribute__((used, section("__verbose"))) = 10; - if (__start___verbose == __stop___verbose + if (& __start___verbose[0] == & __stop___verbose[0] || __start___verbose[0] != 10) return -1; else diff --git a/ld/testsuite/ld-elf/pr21964-3a.c b/ld/testsuite/ld-elf/pr21964-3a.c index 835040ee342..89f7b883573 100644 --- a/ld/testsuite/ld-elf/pr21964-3a.c +++ b/ld/testsuite/ld-elf/pr21964-3a.c @@ -3,7 +3,7 @@ extern int __stop___verbose[]; int foo3 (void) { - if (__start___verbose == __stop___verbose + if (& __start___verbose[0] == & __stop___verbose[0] || __start___verbose[0] != 6) return -1; else