Executing on host: /test/gnu/gcc-3.3/objdir/gcc/xgcc -B/test/gnu/gcc-3.3/objdir/ gcc/ /test/gnu/gcc-3.3/gcc/gcc/testsuite/gcc.dg/attr-weakref-1.c -O2 -fno-show -column /test/gnu/gcc-3.3/gcc/gcc/testsuite/gcc.dg/attr-weakref-1a.c -lm -o ./attr-weakref-1.exe (timeout = 300) ld: Unsatisfied symbol "wf1" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf6" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf9" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv1" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv6" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv9" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf10" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf11" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf12" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf13" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf14" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv10" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv11" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv12" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv13" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv14" in file /var/tmp//ccNG756H.o 16 errors. collect2: ld returned 1 exit status compiler exited with status 1 output is: ld: Unsatisfied symbol "wf1" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf6" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf9" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv1" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv6" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv9" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf10" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf11" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf12" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf13" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf14" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv10" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv11" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv12" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv13" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv14" in file /var/tmp//ccNG756H.o 16 errors. collect2: ld returned 1 exit status FAIL: gcc.dg/attr-weakref-1.c (test for excess errors) Excess errors: ld: Unsatisfied symbol "wf1" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf6" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf9" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv1" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv6" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv9" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf10" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf11" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf12" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf13" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wf14" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv10" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv11" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv12" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv13" in file /var/tmp//ccNG756H.o ld: Unsatisfied symbol "wv14" in file /var/tmp//ccNG756H.o WARNING: gcc.dg/attr-weakref-1.c compilation failed to produce executable
Also fails on hppa2.0w-hp-hpux11.11. So, probably fails on all hppa*-*-hpux* targets.
This blocks PR 24829.
Mine
Does this target actually support weak declarations? It appears to me that it only does when the assembler supports .weak, but even then, the linker will object to undefined weak symbols, which is something this test relies on. I suppose we'd have to mark it as an XFAIL on hpux, or use some alternate dg-require to indicate we need the ability to refer to undefined weak symbols.
Subject: Re: FAIL: gcc.dg/attr-weakref-1.c > Does this target actually support weak declarations? It appears to me that it > only does when the assembler supports .weak, but even then, the linker will > object to undefined weak symbols, which is something this test relies on. I > suppose we'd have to mark it as an XFAIL on hpux, or use some alternate > dg-require to indicate we need the ability to refer to undefined weak symbols. See PR 23387. The HP linkers and dynamic loaders don't like undefined weak symbols. GAS provides support for ".weak" using SOM secondary definition symbols on the 32-bit port. We use this under HP-UX 11 and it is good enough for most purposes. However, the semantics differ from that defined in the sysv ABI. The 64-bit support is a little better supported by the linker, but the dynamic linker still doesn't like undefined weak symbols. We don't support ".weak' under HP-UX 10 due to linker bugs. Either XFAIL or dg-require would be ok. If more tests are likely to be added, maybe dg-require would be better. Dave
Subject: Re: FAIL: gcc.dg/attr-weakref-1.c > Does this target actually support weak declarations? It appears to me that it > only does when the assembler supports .weak, but even then, the linker will > object to undefined weak symbols, which is something this test relies on. I > suppose we'd have to mark it as an XFAIL on hpux, or use some alternate > dg-require to indicate we need the ability to refer to undefined weak symbols. I started looking at the weakref failures in GAS in order to see whether this feature should be disabled in the assembler. One issue that I see is weak local symbols. These are being emitted by GAS under linux and they cause testsuite fails under HP-UX as they come out as global under HP-UX. Weak local symbols are impossible on the HP-UX SOM port and probably on the 64-bit ELF port. On the SOM port, the secondary definition symbols used for weak symbols are always global in scope. It would seem to me that GAS doesn't have to emit undefined weak local symbols, and defined weak local symbols should just be local. If that were possible, it would definitely improve the usefulness of weak references under HP-UX. However, undefined weak references with global scope will always be a problem under HP-UX. I've tried in the past to see if it's possible to support undefined weak symbols. While it's possible to suppress the linker error, the dynamic loader generates an error when it encounters an undefined symbol. As far as I know, there's no way to suppress this error. Dave
The same errors occur on hppa2.0w-hp-hpux11.11 except that ld also dumps core: collect2: ld terminated with signal 10 [Bus error], core dumped /usr/bin/ld: Unsatisfied symbols: wf1 (first referenced in /var/tmp//ccuQuqgk.o) (data) wf6 (first referenced in /var/tmp//ccuQuqgk.o) (data) wf9 (first referenced in /var/tmp//ccuQuqgk.o) (data) wf10 (first referenced in /var/tmp//ccuQuqgk.o) (data) wf11 (first referenced in /var/tmp//ccuQuqgk.o) (data) wf12 (first referenced in /var/tmp//ccuQuqgk.o) (code) wf13 (first referenced in /var/tmp//ccuQuqgk.o) (code) wf14 (first referenced in /var/tmp//ccuQuqgk.o) (data) wv1 (first referenced in /var/tmp//ccuQuqgk.o) (data) wv6 (first referenced in /var/tmp//ccuQuqgk.o) (data) wv9 (first referenced in /var/tmp//ccuQuqgk.o) (data) wv10 (first referenced in /var/tmp//ccuQuqgk.o) (data) wv11 (first referenced in /var/tmp//ccuQuqgk.o) (data) wv12 (first referenced in /var/tmp//ccuQuqgk.o) (data) wv13 (first referenced in /var/tmp//ccuQuqgk.o) (data) wv14 (first referenced in /var/tmp//ccuQuqgk.o) (data) FAIL: gcc.dg/attr-weakref-1.c (test for excess errors)
Created attachment 10447 [details] .s output
Created attachment 10448 [details] .s file
GCC is generating incorrect assembler code for the target of weak references. For example, this is the declaration for "wf1": extern ftype wf1; I.e., it is declared as a function. However, there is no .IMPORT emitted for wf1, or its aliases Wf1a, Wf1b or Wf1c. As a result, the assembler has no way of knowing whether the symbol is code or data. So, it ends up as a data symbol. 00000000 00000000 Data Unsat 0 ......S... 3 00000 wf1 This would seem to indicate that ASM_OUTPUT_EXTERNAL wasn't used for wf1. Failure to type assembler symbols correctly can often cause HP ld to dump core.
Subject: Bug 24827 Author: danglin Date: Sat Dec 31 02:12:34 2005 New Revision: 109197 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109197 Log: PR middle-end/24827 * gcc.dg/attr-weakref-1.c: Skip test on hppa*-*-hpux*. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/attr-weakref-1.c
Subject: Bug 24827 Author: danglin Date: Sat Dec 31 02:18:49 2005 New Revision: 109198 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109198 Log: PR middle-end/24827 * gcc.dg/attr-weakref-1.c: Skip test on hppa*-*-hpux*. Modified: branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/attr-weakref-1.c
It looks like the test was changed to fix this failure. Marking as fixed.