- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: External symbol size mismatch between C and Fo...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2007 05:51 AM
07-26-2007 05:51 AM
External symbol size mismatch between C and Fortran on IA64
A fortran module declares a function with a name that is 33 characters long. A C program is calling this function. When linking, the linker emits:
%ILINK-W-USEUNDEF, undefined symbol SSPLIS_LOTINFOUTIL_DISPATCHSTRI referenced
section: $CODE$
offset: %X000000000000A400 slot: 2
module: TPSTATSHTTP
The fortran module is compiled with the default for /NAMES (which I don't think controls the length).
The C module is compiled with the default for /NAMES (UPPERCASE,TRUNCATED).
I don't see any combination of /NAMES which will result in a match for the linker. In C, I can only choose Truncated or Shortened, and AS_IS only applies to case, not to length. Fortran provides no control that I can find over the length of externals.
Please direct me to the post if this has been answered before.
Thanks;
Glenn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2007 06:59 AM
07-26-2007 06:59 AM
Re: External symbol size mismatch between C and Fortran on IA64
NOTRUNCATE, but:
$ cc /names=notruncate
%DCL-W-NOTNEG, qualifier or keyword not negatable - remove "NO" or omit
\NOTRUNCATE\
Starting to smell like a feature request. A
little ANAL /OBJE action on some simple test
files does suggest that Fortran can create a
longer-than-31-character external name:
[...]
6) Global Symbol Specification (EGSD$C_SYM)
[...]
symbol: "THIS__NAME__IS__36__CHARACTERS__LONG"
[...]
Perhaps someone who knows something will
offer an actual solution, but to me, you sure
look doomed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2007 07:00 AM
07-26-2007 07:00 AM
Re: External symbol size mismatch between C and Fortran on IA64
compatible, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 12:52 AM
07-27-2007 12:52 AM
Re: External symbol size mismatch between C and Fortran on IA64
But, I had no problem getting FORTRAN to generate a symbol with a long name.
000003D8 000000D8 Symbol 9. (00000009) "THIS__NAME__IS__36__CHARACTERS__LONG"
000003D8 000000D8 Name Index in Sec. 11.: 00000049 73.
000003DC 000000DC Symbol Info Field: 12 symtab$b_st_info
Symbol Type: 02 STT_FUNC
Symbol Binding: 01 STB_GLOBAL
000003DD 000000DD Symbol 'Other' Field: 00 symtab$b_st_other
Symbol Visibility 00 STV_DEFAULT
000003DE 000000DE Bound to section: 0006 6. "$CODE$" symtab$w_st_shndx
000003E0 000000E0 Symbol Value 0000000000000000 0. symtab$pq_st_value
000003E8 000000E8 Size associated with sym: 0000000000000010 symtab$q_st_size
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 03:02 AM
07-27-2007 03:02 AM
Re: External symbol size mismatch between C and Fortran on IA64
> generate a symbol with a long name.
Great. Neither did I. Now, if you can get
C to do it, too, you'll have the problem
solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 03:38 AM
07-27-2007 03:38 AM
Re: External symbol size mismatch between C and Fortran on IA64
The FORTRAN names qualifier only allows one to control the case used (upper, lower, as_is).
It seems to me that this is one of the instances in which changes need to be made to the source to do the port from Alpha to Itanium.
CC
/NAMES
/NAMES=(option1,option2)
/NAMES=(UPPERCASE,TRUNCATED) (D)
Option1 converts all definitions and references of external symbols
and psects to the specified case:
o /NAMES=UPPERCASE (default) converts to uppercase.
o /NAMES=AS_IS leaves the case unchanged.
Option2 controls whether or not long external names greater than 31
characters get truncated or shortened:
o /NAMES=TRUNCATED (default) truncates long external names
o /NAMES=SHORTENED shortens long external names.
A shortened name consists of the first 24 characters of the
name followed by a 7-character Cyclic Redundancy Check (CRC)
computed by looking at the full name.
By default, the compiler issues a warning and truncates the name to
31 characters.
The /NAMES qualifier does not affect the names of the $ABS$, $BSS$,
$CODE$, $DATA$, $LINK$, $LITERAL$, and $READONLY$ psects.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 03:56 AM
07-27-2007 03:56 AM
Re: External symbol size mismatch between C and Fortran on IA64
Itanium system:
OpenVMS V8.3, HP Fortran V8.1-1-104930-50GBS, HP C V7.2-001 on OpenVMS IA64 V8.3
Working on my alpha systems, the linker resolves this symbol (well, most of it) correctly in both of these environments:
OpenVMS V7.3-2, HP Fortran 77 V7.6-198-48D52 on OpenVMS Alpha V7.3-2, Compaq C V6.5-001 on OpenVMS Alpha V7.3-2 and
OpenVMS V8.2, HP Fortran 77 V8.0-198-48F7C on OpenVMS Alpha V8.2, HP C V7.1-015 on OpenVMS Alpha V8.2
F77 on Alpha (OpenVMS 8.2; I don't have an 8.3 alpha system) creates symbols truncated to 31 characters:
6) Global Symbol Specification (EGSD$C_SYM)
data type: DSC$K_DTYPE_Z (0)
symbol flags:
(0) EGSY$V_WEAK 0
(1) EGSY$V_DEF 1
(2) EGSY$V_UNI 0
(3) EGSY$V_REL 1
(4) EGSY$V_COMM 0
(5) EGSY$V_VECEP 0
(6) EGSY$V_NORM 1
psect: 4
value: 56 (%X'00000038')
code address psect: 3
code address: 0 (%X'00000000')
symbol: "SSPLIS_LOTINFOUTIL_DISPATCHSTRI"
whereas F90 (on Itanium) defines the entire symbol:
00001DB8 00000198 Symbol 17. (00000011) "SSPLIS_LOTINFOUTIL_DISPATCHSTRING"
00001DB8 00000198 Name Index in Sec. 11.: 00000025 37.
00001DBC 0000019C Symbol Info Field: 12 symtab$b_st_info
Symbol Type: 02 STT_FUNC
Symbol Binding: 01 STB_GLOBAL
00001DBD 0000019D Symbol 'Other' Field: 00 symtab$b_st_other
Symbol Visibility 00 STV_DEFAULT
00001DBE 0000019E Bound to section: 0006 6. "$CODE$" symtab$w_st_shndx
00001DC0 000001A0 Symbol Value 0000000000000000 0. symtab$pq_st_value
00001DC8 000001A8 Size associated with sym: 0000000000001080 symtab$q_st_size
Which reminds me of another issue:
The long-named function in Fortran is contained in a source file which also contains about 6 other subroutines and functions (it being the last one in the file). When I do Analyze/object on the F90 output (on Itanium), it only reports informtion on some of the modules. To get the above analyze/object output, I had to copy the function out into a source file containing only that function, compile and analyze/object that file. Sometimes (dependent on what sections I chose???) I would get analysis output for only the first module in the source file; other times it would give me the first 3 (of 7) modules.
If this has been answered, please point me to that entry; otherwise, I'll start a new thread on this one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 03:56 AM
07-27-2007 03:56 AM
Re: External symbol size mismatch between C and Fortran on IA64
> instances in which changes need to be made
> to the source to do the port from Alpha to
> Itanium.
I don't see an Alpha-IA64 difference here,
only a C-Fortran difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 04:41 AM
07-27-2007 04:41 AM
Re: External symbol size mismatch between C and Fortran on IA64
>> instances in which changes need to be made
>> to the source to do the port from Alpha to
>> Itanium.
>
>I don't see an Alpha-IA64 difference here,
>only a C-Fortran difference.
I agree that this is an F77/F90 vs C compatibility issue, but it may be only present on Itanium (due to the ELF object format, and the Intel compiler back end); I don't have F90 on alpha to test (Perhaps Steven/Richard could reference their "THIS__NAME__IS__36__CHARACTERS__LONG" fortran symbol from a C routine and see if the alpha linker truncates the def??)
I've written a jacket routine in fortran whose name fits in 31 characters, and calls SSPLIS_LOTINFOUTIL_DISPATCHSTRING, which resolved the undefined symbol. Fortunately in all the code I'm porting, I've only seen this one symbol that is too long. I'd hate to have to do that for dozens or hundreds of symbols. I have some C++ stuff to do later
and those names are notorious for their length. I'm holding my breath.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 05:06 AM
07-27-2007 05:06 AM
Re: External symbol size mismatch between C and Fortran on IA64
> Itanium [...]
On my Alpha, Fortran 90 easily gives a
36-character global symbol, as shown before.
Fortran 77 complains:
alp $ fortran /old_f77 TRUNF.FOR
function this__name__is__36__characters__long()
...............^
%FORT-W-NAMTOOLON, Name longer than 31 characters
at line number 1 in file ALP$DKA0:[SMS]TRUNF.FOR;3
[...]
I see no way to get DEC/Compaq/HP C to emit
a global symbol longer than 31 characters,
but I'm always open to enlightenment.
> I have some C++ stuff to do later
> and those names are notorious for their
> length. [...]
And for the name-mangling which is done to
shorten them when they go global.
HELP CXXDEMANGLE
Around here:
alp $ fortran /version
HP Fortran V7.6-3276-48D52
alp $ fortran /old_f77 /version
HP Fortran 77 V7.6-198-48D52 on OpenVMS Alpha V7.3-2
alp $ cc /version
HP C V7.1-015 on OpenVMS Alpha V7.3-2
(But a quick check of "HP C V7.3-018 on
OpenVMS IA64 V8.3" on a TestDrive system
didn't reveal any new /NAMES options.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 06:29 AM
07-27-2007 06:29 AM
Re: External symbol size mismatch between C and Fortran on IA64
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2007 08:20 AM
07-27-2007 08:20 AM
Re: External symbol size mismatch between C and Fortran on IA64
Thanks!
Glenn