Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Wed, 10 Sep 2008 14:28:01 +0100,    group: microsoft.public.vstudio.development        back       


How do I stop the C/C++ linker from removing unreferences symbols   
Hello all,

Our application code contains a number of C functions that are designed to 
only be called by developers from the VS debugger. These functions are never 
called directly by the application.

Problem is that the VS2005 linker seems to remove these functions from the 
exe image at link time, so that they cannot be called from the debugger. The 
VS2003 linker did not to this and the functions were available.

So, is there a flag to stop the linker removing these functions?


Cheers,

John
date: Wed, 10 Sep 2008 14:28:01 +0100   author:   JohnD

Re: How do I stop the C/C++ linker from removing unreferences symbols   
JohnD wrote:
> Hello all,
> 
> Our application code contains a number of C functions that are designed 
> to only be called by developers from the VS debugger. These functions 
> are never called directly by the application.
> 
> Problem is that the VS2005 linker seems to remove these functions from 
> the exe image at link time, so that they cannot be called from the 
> debugger. The VS2003 linker did not to this and the functions were 
> available.
> 
> So, is there a flag to stop the linker removing these functions?
> 
> 
> Cheers,
> 
> John
> 
> 

http://msdn.microsoft.com/en-us/library/bxwfs976(VS.80).aspx
date: Wed, 10 Sep 2008 09:07:39 -0500   author:   BobF d

Re: How do I stop the C/C++ linker from removing unreferences symbols   
Hi Bob,

Interesting, but I do have /DEBUG set in the linker options, so the linker 
should be leaving the functions. I'll investigate a littler further but I 
think "strange things are happening".

/john

"BobF" <nothanks@spamfree.world> wrote in message 
news:%23ZeDX60EJHA.4336@TK2MSFTNGP05.phx.gbl...
> JohnD wrote:
>> Hello all,
>>
>> Our application code contains a number of C functions that are designed 
>> to only be called by developers from the VS debugger. These functions are 
>> never called directly by the application.
>>
>> Problem is that the VS2005 linker seems to remove these functions from 
>> the exe image at link time, so that they cannot be called from the 
>> debugger. The VS2003 linker did not to this and the functions were 
>> available.
>>
>> So, is there a flag to stop the linker removing these functions?
>>
>>
>> Cheers,
>>
>> John
>>
>>
>
> http://msdn.microsoft.com/en-us/library/bxwfs976(VS.80).aspx
date: Wed, 10 Sep 2008 15:54:06 +0100   author:   JohnD

Re: How do I stop the C/C++ linker from removing unreferences symbols   
JohnD wrote:
> Hi Bob,
> 
> Interesting, but I do have /DEBUG set in the linker options, so the 
> linker should be leaving the functions. I'll investigate a littler 
> further but I think "strange things are happening".
> 
> /john
> 

That should work fine UNLESS you also have /OPT:REF explicitly set. 
Explicitly setting /OPT:REF will override what /DEBUG does with this 
option by default.


> "BobF" <nothanks@spamfree.world> wrote in message 
> news:%23ZeDX60EJHA.4336@TK2MSFTNGP05.phx.gbl...
>> JohnD wrote:
>>> Hello all,
>>>
>>> Our application code contains a number of C functions that are 
>>> designed to only be called by developers from the VS debugger. These 
>>> functions are never called directly by the application.
>>>
>>> Problem is that the VS2005 linker seems to remove these functions 
>>> from the exe image at link time, so that they cannot be called from 
>>> the debugger. The VS2003 linker did not to this and the functions 
>>> were available.
>>>
>>> So, is there a flag to stop the linker removing these functions?
>>>
>>>
>>> Cheers,
>>>
>>> John
>>>
>>>
>>
>> http://msdn.microsoft.com/en-us/library/bxwfs976(VS.80).aspx 
>
date: Wed, 10 Sep 2008 10:29:04 -0500   author:   BobF d

Re: How do I stop the C/C++ linker from removing unreferences symbols   
Hmm,

Seems I need both /DEBUG and /OPT:NOREF.

I wonder if there's another setting that I have that is affecting this too. 
How odd.

/john

"BobF" <nothanks@spamfree.world> wrote in message 
news:uJGA2n1EJHA.1460@TK2MSFTNGP03.phx.gbl...
> JohnD wrote:
>> Hi Bob,
>>
>> Interesting, but I do have /DEBUG set in the linker options, so the 
>> linker should be leaving the functions. I'll investigate a littler 
>> further but I think "strange things are happening".
>>
>> /john
>>
>
> That should work fine UNLESS you also have /OPT:REF explicitly set. 
> Explicitly setting /OPT:REF will override what /DEBUG does with this 
> option by default.
>
>
>> "BobF" <nothanks@spamfree.world> wrote in message 
>> news:%23ZeDX60EJHA.4336@TK2MSFTNGP05.phx.gbl...
>>> JohnD wrote:
>>>> Hello all,
>>>>
>>>> Our application code contains a number of C functions that are designed 
>>>> to only be called by developers from the VS debugger. These functions 
>>>> are never called directly by the application.
>>>>
>>>> Problem is that the VS2005 linker seems to remove these functions from 
>>>> the exe image at link time, so that they cannot be called from the 
>>>> debugger. The VS2003 linker did not to this and the functions were 
>>>> available.
>>>>
>>>> So, is there a flag to stop the linker removing these functions?
>>>>
>>>>
>>>> Cheers,
>>>>
>>>> John
>>>>
>>>>
>>>
>>> http://msdn.microsoft.com/en-us/library/bxwfs976(VS.80).aspx
>>
date: Fri, 12 Sep 2008 14:42:57 +0100   author:   JohnD

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us