#define ASM_OUTPUT_LABEL(FILE,NAME) \
do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
+/* Used in lieu of '../elfos.h:ASM_WEAKEN_LABEL'. */
+#define ASM_WEAKEN_DECL(STREAM, DECL, NAME, VALUE) \
+ gcn_asm_weaken_decl ((STREAM), (DECL), (NAME), (VALUE))
+
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
asm_fprintf (FILE, "%U%s", default_strip_name_encoding (NAME))
#define _GCN_PROTOS_
extern void gcn_asm_output_symbol_ref (FILE *file, rtx x);
+extern void gcn_asm_weaken_decl (FILE *stream, tree decl, const char *name,
+ const char *value);
extern tree gcn_builtin_decl (unsigned code, bool initialize_p);
extern bool gcn_can_split_p (machine_mode, rtx);
extern bool gcn_constant64_p (rtx);
}
}
+void
+gcn_asm_weaken_decl (FILE *stream, tree decl, const char *name,
+ const char *value)
+{
+ if (!value
+ && DECL_EXTERNAL (decl))
+ /* Don't emit weak undefined symbols; see PR119369. */
+ return;
+ if (value)
+ ASM_OUTPUT_WEAK_ALIAS (stream, name, value);
+ else
+ ASM_WEAKEN_LABEL (stream, name);
+}
+
/* Implement TARGET_CONSTANT_ALIGNMENT.
Returns the alignment in bits of a constant that is being placed in memory.
// { dg-additional-options "-fno-rtti -nostdlib++" }
// { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } }
// { dg-xfail-if "AIX weak" { powerpc-ibm-aix* } }
+// { dg-xfail-if PR119369 { amdgcn-*-* } }
struct A
{
// { dg-require-weak "" }
// { dg-require-alias "" }
// { dg-skip-if "No .weak" { { hppa*-*-hpux* } && { ! lp64 } } }
+// { dg-skip-if PR119369 { amdgcn-*-* } }
struct Base
{
// { dg-do compile }
// { dg-require-weak "" }
// { dg-options "" }
+// { dg-skip-if PR119369 { amdgcn-*-* } }
// { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?_Z3foov" } }
// is not available on the following targets. The test is skipped rather than
// xfailed to suppress the warning that would otherwise arise.
// { dg-skip-if "" { "hppa*-*-hpux*" "*-*-aix*" "nvptx-*-*" } }
+// { dg-skip-if PR119369 { amdgcn-*-* } }
// For kernel modules and static RTPs, the loader treats undefined weak
// symbols in the same way as undefined strong symbols. The test
/* { dg-skip-if "" { *-*-mingw* } } */
/* NVPTX's definition of weak looks different to normal. */
/* { dg-skip-if "" { nvptx-*-* } } */
+/* { dg-skip-if PR119369 { amdgcn-*-* } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?b" } } */
/* { dg-options "" } */
/* NVPTX's weak is applied to the definition, not declaration. */
/* { dg-skip-if "" { nvptx-*-* } } */
+/* { dg-skip-if PR119369 { amdgcn-*-* } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?foo" } } */
/* { dg-skip-if "" { x86_64-*-mingw* } } */
/* NVPTX's weak is applied to the definition, not declaration. */
/* { dg-skip-if "" { nvptx-*-* } } */
+/* { dg-skip-if PR119369 { amdgcn-*-* } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */
/* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?b" } } */
/* { dg-skip-if "" { x86_64-*-mingw* } } */
/* NVPTX's weak is applied to the definition, not declaration. */
/* { dg-skip-if "" { nvptx-*-* } } */
+/* { dg-skip-if PR119369 { amdgcn-*-* } } */
extern int kallsyms_token_index[] __attribute__((weak));
extern int kallsyms_token_table[] __attribute__((weak));
/* { dg-skip-if "" { x86_64-*-mingw* } } */
/* NVPTX's definition of weak looks different to normal. */
/* { dg-skip-if "" { nvptx-*-* } } */
+/* { dg-skip-if PR119369 { amdgcn-*-* } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
/* { dg-require-weak "" } */
/* { dg-options "-fno-common -Waddress" } */
/* { dg-skip-if "" { x86_64-*-mingw* } } */
+/* { dg-skip-if PR119369 { amdgcn-*-* } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
/* { dg-skip-if "" { x86_64-*-mingw* } } */
/* NVPTX's definition of weak looks different to normal. */
/* { dg-skip-if "" { nvptx-*-* } } */
+/* { dg-skip-if PR119369 { amdgcn-*-* } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */
/* { dg-require-alias "" } */
/* { dg-options "-fno-common" } */
/* { dg-skip-if "" { x86_64-*-mingw* } } */
+/* { dg-skip-if PR119369 { amdgcn-*-* } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */