clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
17 stars 5 forks source link

Cannot link if UPC link script is disabled #57

Closed nenadv closed 10 years ago

nenadv commented 10 years ago

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).

nenadv commented 10 years ago

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.