For all ELF targets we use the UPC link script (upc.ld) for UPC program linking. However, we have an option to enable/disable the link script and if link script is disabled one gets the following error when running the program:
symbol lookup error: ./program: undefined symbol: __upc_shared_start
Note that we are able to link the program. I verified that upc-crtbegin.o is on the link line.
I think the problem is related on section .upc_shared attributes. 'objdump' shows flag READONLY on the upc_shared section (while GUPC shows ALLOC). The following section line is being created for each shared variable:
.section upc_shared,"",@nobits
with no flags set (while GUPC has "aw" flags).
I am filing this under clang-upc but I think that we might need to change llvm-upc where sections are being defined (lib/MC).
The other related issue is that we include an option "-Tupc.ld" on the link line for ELF targets regardless of the UPC link script being disabled/enabled.
For all ELF targets we use the UPC link script (upc.ld) for UPC program linking. However, we have an option to enable/disable the link script and if link script is disabled one gets the following error when running the program:
Note that we are able to link the program. I verified that upc-crtbegin.o is on the link line.
I think the problem is related on section .upc_shared attributes. 'objdump' shows flag READONLY on the upc_shared section (while GUPC shows ALLOC). The following section line is being created for each shared variable:
with no flags set (while GUPC has "aw" flags).
I am filing this under clang-upc but I think that we might need to change llvm-upc where sections are being defined (lib/MC).