HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ld and -y option
Operating System - HP-UX
1833758
Members
3613
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
03-09-2004 06:16 AM
03-09-2004 06:16 AM
ld and -y
In the HP-DOCS "-y symbol Indicate each file in which symbol appears. More than one symbol can be specified, but each must be preceded by -y."
"Indicate each file" <-- what does this mean? Do I put the "symbol" here or the file name? I would like to have more of a description of what the "-y" option does.
Thank you,
Steve
In the HP-DOCS "-y symbol Indicate each file in which symbol appears. More than one symbol can be specified, but each must be preceded by -y."
"Indicate each file" <-- what does this mean? Do I put the "symbol" here or the file name? I would like to have more of a description of what the "-y" option does.
Thank you,
Steve
Not as is, is now
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2004 07:28 AM
03-09-2004 07:28 AM
Solution
You are making this harder than it is. I suppose that it would make more sense if the man page read "PRINT each file" rather than "INDICATE" each file. The idea is that the linker tells you (rather than the other way around) every file in which the symbol is found. For example, if the function "Mickey" and the variable "Mouse" were referenced/defined in several files, -y will tell you where each instance of the symbol is found.
ld -y Mickey -y Mouse file1.o file2.o file3.o .... libraries
might do something like this:
file1.o: Mickey is ENTRY UNIVERSAL
file3.o: Mouse is DATA UNIVERSAL
"indicating" that Mickey is found in file1.o and Mouse is found in file3.o.
More commonly it's passed in to the linker from the compiler so it would be done like this:
cc -Wl,-y Mickey -Wl,-y Mouse -o file file1.c file2.o file3.o
In some implementations, you actually need to prepend each symbol with an underscore but that is not necessary under HP-UX.
ld -y Mickey -y Mouse file1.o file2.o file3.o .... libraries
might do something like this:
file1.o: Mickey is ENTRY UNIVERSAL
file3.o: Mouse is DATA UNIVERSAL
"indicating" that Mickey is found in file1.o and Mouse is found in file3.o.
More commonly it's passed in to the linker from the compiler so it would be done like this:
cc -Wl,-y Mickey -Wl,-y Mouse -o file file1.c file2.o file3.o
In some implementations, you actually need to prepend each symbol with an underscore but that is not necessary under HP-UX.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2004 07:34 AM
03-09-2004 07:34 AM
Re: ld and -y option
Hi Steve,
# cc -c t.c
# cc -c x.c
# ld -y toto -y yoyo t.o x.o -r
t.o: yoyo is DATA UNIVERSAL
t.o: toto is CODE UNSAT
x.o: toto is ENTRY UNIVERSAL
# cat t.c
int yoyo=1;
main()
{
toto();
}
# cat x.c
toto()
{
}
# cc -c t.c
# cc -c x.c
# ld -y toto -y yoyo t.o x.o -r
t.o: yoyo is DATA UNIVERSAL
t.o: toto is CODE UNSAT
x.o: toto is ENTRY UNIVERSAL
# cat t.c
int yoyo=1;
main()
{
toto();
}
# cat x.c
toto()
{
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2004 07:39 AM
03-09-2004 07:39 AM
Re: ld and -y option
thank you
Not as is, is now
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP