Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Executable name: (11 Items)
   
Executable name  
Using custom makefile that are basicaly identical under Windows and QNX6, the executable name in the ELF file is 
different.  When build under QNX6 the filename matches the file in ELF, that means if I start the program slay <execname
> will work.  

But build under Windows I have to do slay obj/<execname>.  I do get around this?
Re: Executable name  
Mario Charest wrote:
> Using custom makefile that are basicaly identical under Windows and QNX6, the executable name in the ELF file is 
different.  When build under QNX6 the filename matches the file in ELF, that means if I start the program slay <execname
> will work.  
> 
> But build under Windows I have to do slay obj/<execname>.  I do get around this?

Are you adding a use message or a stack note to the binary? The problem 
is that by default ldrel used to add a debug path note to the binary and 
the loader would set the program name using the information provided by 
the note. ldrel was modified awhile back not add the debug path by 
default. If you build yourself an updated ldrel for 6.3.2 and rebuild 
your executable, you should be able to slay it with the proper progname.

Regards,

Ryan Mansfield
RE: Executable name  

-----Original Message-----
From: Ryan Mansfield [mailto:community-noreply@qnx.com]
Sent: November-12-08 3:58 PM
To: general-toolchain
Subject: Re: Executable name

Mario Charest wrote:
> Using custom makefile that are basicaly identical under Windows and QNX6, the executable name in the ELF file is 
different.  When build under QNX6 the filename matches the file in ELF, that means if I start the program slay <execname
> will work.
>
> But build under Windows I have to do slay obj/<execname>.  I do get around this?

Are you adding a use message or a stack note to the binary?

Yes we are adding a use message?  I'll check what's it's doing

The problem
is that by default ldrel used to add a debug path note to the binary and
the loader would set the program name using the information provided by
the note. ldrel was modified awhile back not add the debug path by
default. If you build yourself an updated ldrel for 6.3.2 and rebuild
your executable, you should be able to slay it with the proper progname.

Scary ;-) Strange that the self hosted and windows version don't behave the same though.

Regards,

Ryan Mansfield


_______________________________________________
General
http://community.qnx.com/sf/go/post16496

Re: Executable name  
Mario Charest wrote:
> 
> -----Original Message-----
> From: Ryan Mansfield [mailto:community-noreply@qnx.com]
> Sent: November-12-08 3:58 PM
> To: general-toolchain
> Subject: Re: Executable name
> 
> Mario Charest wrote:
>> Using custom makefile that are basicaly identical under Windows and QNX6, the executable name in the ELF file is 
different.  When build under QNX6 the filename matches the file in ELF, that means if I start the program slay <execname
> will work.
>>
>> But build under Windows I have to do slay obj/<execname>.  I do get around this?
> 
> Are you adding a use message or a stack note to the binary?
> 
> Yes we are adding a use message?  I'll check what's it's doing
> 
> The problem
> is that by default ldrel used to add a debug path note to the binary and
> the loader would set the program name using the information provided by
> the note. ldrel was modified awhile back not add the debug path by
> default. If you build yourself an updated ldrel for 6.3.2 and rebuild
> your executable, you should be able to slay it with the proper progname.
> 
> Scary ;-) Strange that the self hosted and windows version don't behave the same though.

It is, really.  If you do a pidin you should see obj/execname in the native case, and obj\execname in the windows case 
(note the backslash)
slay does a basename() on the binary, so slay <execname> will work for the first one.  But it fails to realize that 
backslash is a directory
seperator, so it fails for the windows version.

The QNT_DEBUG_FULLPATH stuff was done long long ago before anyone ever dreamed of windows hosted development, I suspect,
 but was removed in 640, thanksfully.

Colin

> Regards,
> 
> Ryan Mansfield
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16496
> 
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16497
> 

-- 
cburgess@qnx.com
Re: Executable name  
Colin Burgess wrote:

[ Tales of Windows and QNX binaries reporting different names snippped ]

>  The QNT_DEBUG_FULLPATH stuff was done long long ago before anyone
>  ever dreamed of windows hosted development, I suspect, but was
>  removed in 640, thanksfully.

C'mon .. that's not fair at all =;-)  The DEBUG_FULLPATH stuff is 
actually there
to provide debuggers with additional intelligence so that users would 
have to specify
less 'stuff' .  The fact that it never got used (inspired from the 
Watcom toolchain is
my understanding of this bit of history) isn't the ELF sections fault =;-)

The _real_ problem has nothing to do with the DEBUG_FULLPATH but rather the
fact that extracting the "name of the thing that was executed" never had 
a proper API
in Neutrino so the defacto use of DEBUG_FULLPATH became to use it to 
associate
a name with a pid and once that happened ... well we are where we are today.

Thankfully this was all cleaned up and made better in 6.4.0, and though 
the name is
wonkey, the behaviour is consistant ... thanks Colin!

Thomas
RE: Executable name  

________________________________________
From: Ryan Mansfield [community-noreply@qnx.com]
Sent: Wednesday, November 12, 2008 3:57 PM
To: general-toolchain
Subject: Re: Executable name

Mario Charest wrote:
> Using custom makefile that are basicaly identical under Windows and QNX6, the executable name in the ELF file is 
different.  When build under QNX6 the filename matches the file in ELF, that means if I start the program slay <execname
> will work.
>
> But build under Windows I have to do slay obj/<execname>.  I do get around this?

If you build yourself an updated ldrel for 6.3.2 and rebuild
your executable, you should be able to slay it with the proper progname.

Since the problem is for Windows how would I go about compiling a version for Windows?  I mean it has to be a windows 
binary!!!!

Regards,

Ryan Mansfield


_______________________________________________
General
http://community.qnx.com/sf/go/post16496
RE: Executable name  
Ryan isn't the 640 version fixed?  Mario you have the 640 release version, right?


-----Original Message-----
From: Mario Charest [mailto:community-noreply@qnx.com]
Sent: Thu 11/13/2008 5:47 PM
To: general-toolchain
Subject: RE: Executable name
 


________________________________________
From: Ryan Mansfield [community-noreply@qnx.com]
Sent: Wednesday, November 12, 2008 3:57 PM
To: general-toolchain
Subject: Re: Executable name

Mario Charest wrote:
> Using custom makefile that are basicaly identical under Windows and QNX6, the executable name in the ELF file is 
different.  When build under QNX6 the filename matches the file in ELF, that means if I start the program slay <execname
> will work.
>
> But build under Windows I have to do slay obj/<execname>.  I do get around this?

If you build yourself an updated ldrel for 6.3.2 and rebuild
your executable, you should be able to slay it with the proper progname.

Since the problem is for Windows how would I go about compiling a version for Windows?  I mean it has to be a windows 
binary!!!!

Regards,

Ryan Mansfield


_______________________________________________
General
http://community.qnx.com/sf/go/post16496

_______________________________________________
General
http://community.qnx.com/sf/go/post16544

Attachment: Text winmail.dat 2.85 KB
RE: Executable name  
Nah still can`t use 640 until we can build 6.3.2 executable (gcc 3) from 6.4.0 (self-hosted)

________________________________________
From: Colin Burgess [community-noreply@qnx.com]
Sent: Thursday, November 13, 2008 9:33 PM
To: general-toolchain
Subject: RE: Executable name

Ryan isn't the 640 version fixed?  Mario you have the 640 release version, right?


-----Original Message-----
From: Mario Charest [mailto:community-noreply@qnx.com]
Sent: Thu 11/13/2008 5:47 PM
To: general-toolchain
Subject: RE: Executable name



________________________________________
From: Ryan Mansfield [community-noreply@qnx.com]
Sent: Wednesday, November 12, 2008 3:57 PM
To: general-toolchain
Subject: Re: Executable name

Mario Charest wrote:
> Using custom makefile that are basicaly identical under Windows and QNX6, the executable name in the ELF file is 
different.  When build under QNX6 the filename matches the file in ELF, that means if I start the program slay <execname
> will work.
>
> But build under Windows I have to do slay obj/<execname>.  I do get around this?

If you build yourself an updated ldrel for 6.3.2 and rebuild
your executable, you should be able to slay it with the proper progname.

Since the problem is for Windows how would I go about compiling a version for Windows?  I mean it has to be a windows 
binary!!!!

Regards,

Ryan Mansfield


_______________________________________________
General
http://community.qnx.com/sf/go/post16496

_______________________________________________
General
http://community.qnx.com/sf/go/post16544



_______________________________________________
General
http://community.qnx.com/sf/go/post16548
Re: Executable name  
Mario Charest wrote:
> Nah still can`t use 640 until we can build 6.3.2 executable (gcc 3) from 6.4.0 (self-hosted)

I think Colin was suggesting you replace your 6.3.2 ldrel with the 6.4.0 
ldrel. You don't need to switch your entire SDK just to pick up this fix.

Regards,

Ryan Mansfield

> ______________________________________
> From: Colin Burgess [community-noreply@qnx.com]
> Sent: Thursday, November 13, 2008 9:33 PM
> To: general-toolchain
> Subject: RE: Executable name
> 
> Ryan isn't the 640 version fixed?  Mario you have the 640 release version, right?
> 
> 
> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com]
> Sent: Thu 11/13/2008 5:47 PM
> To: general-toolchain
> Subject: RE: Executable name
> 
> 
> 
> ________________________________________
> From: Ryan Mansfield [community-noreply@qnx.com]
> Sent: Wednesday, November 12, 2008 3:57 PM
> To: general-toolchain
> Subject: Re: Executable name
> 
> Mario Charest wrote:
>> Using custom makefile that are basicaly identical under Windows and QNX6, the executable name in the ELF file is 
different.  When build under QNX6 the filename matches the file in ELF, that means if I start the program slay <execname
> will work.
>>
>> But build under Windows I have to do slay obj/<execname>.  I do get around this?
> 
> If you build yourself an updated ldrel for 6.3.2 and rebuild
> your executable, you should be able to slay it with the proper progname.
> 
> Since the problem is for Windows how would I go about compiling a version for Windows?  I mean it has to be a windows 
binary!!!!
> 
> Regards,
> 
> Ryan Mansfield
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16496
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16544
> 
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16548
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16571
> 
RE: Executable name  
Oh sorry. That indeed fixed the problem.

Thanks !!!!!

________________________________________
From: Ryan Mansfield [community-noreply@qnx.com]
Sent: Friday, November 14, 2008 8:06 AM
To: general-toolchain
Subject: Re: Executable name

Mario Charest wrote:
> Nah still can`t use 640 until we can build 6.3.2 executable (gcc 3) from 6.4.0 (self-hosted)

I think Colin was suggesting you replace your 6.3.2 ldrel with the 6.4.0
ldrel. You don't need to switch your entire SDK just to pick up this fix.

Regards,

Ryan Mansfield

> ______________________________________
> From: Colin Burgess [community-noreply@qnx.com]
> Sent: Thursday, November 13, 2008 9:33 PM
> To: general-toolchain
> Subject: RE: Executable name
>
> Ryan isn't the 640 version fixed?  Mario you have the 640 release version, right?
>
>
> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com]
> Sent: Thu 11/13/2008 5:47 PM
> To: general-toolchain
> Subject: RE: Executable name
>
>
>
> ________________________________________
> From: Ryan Mansfield [community-noreply@qnx.com]
> Sent: Wednesday, November 12, 2008 3:57 PM
> To: general-toolchain
> Subject: Re: Executable name
>
> Mario Charest wrote:
>> Using custom makefile that are basicaly identical under Windows and QNX6, the executable name in the ELF file is 
different.  When build under QNX6 the filename matches the file in ELF, that means if I start the program slay <execname
> will work.
>>
>> But build under Windows I have to do slay obj/<execname>.  I do get around this?
>
> If you build yourself an updated ldrel for 6.3.2 and rebuild
> your executable, you should be able to slay it with the proper progname.
>
> Since the problem is for Windows how would I go about compiling a version for Windows?  I mean it has to be a windows 
binary!!!!
>
> Regards,
>
> Ryan Mansfield
>
>
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16496
>
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16544
>
>
>
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16548
>
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post16571
>

_______________________________________________
General
http://community.qnx.com/sf/go/post16573
Re: Executable name  
Colin Burgess wrote:
> Ryan isn't the 640 version fixed?  Mario you have the 640 release 
> version, right?

Yeah, it's fixed in 6.4.

Regards,

Ryan Mansfield