gold: Disable &no_such_symbol_ != NULL check when GOT in use

Since this test:

  if (&no_such_symbol_ != NULL)
    {
      fprintf(stderr, "FAILED weak undef test 4: %s\n",
              "&no_such_symbol_ is not NULL");
      status = 1;
    }

always fails when GOT is used and aarch64 always uses GOT, disable it
for aarch64 and PIC.

	PR gold/32112
	* testsuite/weak_undef_test.cc (main): Disable the
	&no_such_symbol_ != NULL check for aarch64 and PIC.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
H.J. Lu
2024-08-23 16:03:44 -07:00
parent 57a3845126
commit dbb062e5e9

View File

@@ -81,12 +81,15 @@ main()
status = 1; status = 1;
} }
#if !defined __PIC__ && !defined __aarch64__
// This test always fails when GOT is used.
if (&no_such_symbol_ != NULL) if (&no_such_symbol_ != NULL)
{ {
fprintf(stderr, "FAILED weak undef test 4: %s\n", fprintf(stderr, "FAILED weak undef test 4: %s\n",
"&no_such_symbol_ is not NULL"); "&no_such_symbol_ is not NULL");
status = 1; status = 1;
} }
#endif
if (p1 != NULL) if (p1 != NULL)
{ {