Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linker fails when binary file already exists

Status
Not open for further replies.

jpn1

Technical User
Jul 9, 2007
34
US
I am linking 4 C object files together to produce the executable file. If the binary file does not exist, it creates the executable with my user owner:group. I can then re-run the linker and it will over-write the executable and the owner:group will remain the same. All is good.

If another user comes and try's to re-create the executable the linker will output some warnings and an error and will create the executable. If the user who had the failure changes the ownership to match him and re-runs the linker works.

For some reason when the executable file is already there and has different owner:group from the user running the linker the linker has a problem. If the file is not there at all or the owner:group matches the user running the linker, the executable will create with out issue.

ld: 0711-224 WARNING: Duplicate symbol: .memset
ld: 0711-224 WARNING: Duplicate symbol: memset
ld: 0711-224 WARNING: Duplicate symbol: .memcpy
ld: 0711-224 WARNING: Duplicate symbol: .memmove
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-856 ERROR: Cannot set the mode of the output file: rts1.OMI
ld:fchmod() Operation not permitted.

I can add a line in the linker script to check for the file and remove it first, but I wish I knew why this is happening. This is AIX 7.1 with xlC 10. I can perform the same actions on an AIX 6.1 xlC 10 server and it doesn't care if the file is already there and owned by a different user. It will overwrite with the current user owner:group.

I thank any ideas.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top