CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Curious about dumpbin output

    About 3 years ago I compiled a DLL containing a library of audio processors called Vamp plugins. Three years later, a few more plugins have been added to the library so yesterday, I decided to rebuild it. Unfortunately, the new build doesn't seem to be working

    Before I dig too deeply.. there's an obvious difference if I run dumpbin /EXPORTS on the built lib. Here's the older build (note the highlighted line)

    Code:
    Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    Dump of file libardourvampplugins.dll
    
    File Type: DLL
    
      Section contains the following exports for libardourvampplugins.dll
    
        00000000 characteristics
        53536D48 time date stamp Sun Apr 20 07:46:32 2014
            0.00 version
               1 ordinal base
               1 number of functions
               1 number of names
    
        ordinal hint RVA      name
    
              1    0 0000E540 vampGetPluginDescriptor = _vampGetPluginDescriptor
    
      Summary
    
            1000 .data
            5000 .rdata
            2000 .reloc
            1000 .rsrc
           14000 .text
    and here's the version from yesterday...

    Code:
    Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    Dump of file libardourvampplugins.dll
    
    File Type: DLL
    
      Section contains the following exports for libardourvampplugins.dll
    
        00000000 characteristics
        5899905A time date stamp Tue Feb 07 09:16:10 2017
            0.00 version
               1 ordinal base
               1 number of functions
               1 number of names
    
        ordinal hint RVA      name
    
              1    0 00001BA9 vampGetPluginDescriptor
    
      Summary
    
            2000 .data
            3000 .idata
           13000 .rdata
            5000 .reloc
            1000 .rsrc
           81000 .text
    Does that difference signify something?? Both were built using MSVC 8 and I used the same version of dumpbin in both cases..
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  2. #2
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,825

    Re: Curious about dumpbin output

    I think that the LHS name is the exported name and the RHS name is the internal name. From the code, is the name VampGet or _VampGet?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #3
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: Curious about dumpbin output

    Quote Originally Posted by 2kaud View Post
    I think that the LHS name is the exported name and the RHS name is the internal name. From the code, is the name VampGet or _VampGet?
    Hi 2kaud. The name is "vampGetPluginDescriptor" (without an underscore). But IIRC an underscore indicates that the function got exported with 'C' linkage. C++ functions normally have some name mangling stuff (except that this one happens to be in global scope so there's no classname or namespace etc). Here's what I see if I build a Debug version:

    Code:
    Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    Dump of file libardourvampplugins.dll
    
    File Type: DLL
    
      Section contains the following exports for libardourvampplugins.dll
    
        00000000 characteristics
        589AFF64 time date stamp Wed Feb 08 11:22:12 2017
            0.00 version
               1 ordinal base
               1 number of functions
               1 number of names
    
        ordinal hint RVA      name
    
              1    0 00001974 vampGetPluginDescriptor = @ILT+2415(_vampGetPluginDescriptor)
    
      Summary
    
            2000 .data
            3000 .idata
           2A000 .rdata
            7000 .reloc
            1000 .rsrc
           AC000 .text
    I'm guessing that the Release build is exporting the function as C++ somehow
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  4. #4
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,825

    Re: Curious about dumpbin output

    To stop the name mangling and export as c, you use extern "c" {...} around the import/export. See
    https://msdn.microsoft.com/en-us/library/ys435b3s.aspx
    https://msdn.microsoft.com/en-us/library/wf2w9f6x.aspx

    PS Does the project use a .def file?
    Last edited by 2kaud; February 8th, 2017 at 06:52 AM. Reason: PS
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  5. #5
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: Curious about dumpbin output

    Quote Originally Posted by 2kaud View Post
    PS Does the project use a .def file?
    Yes, it looks like this:

    Code:
    ; Auto-generated by create_symbols_file.py
    
    LIBRARY libardourvampplugins.dll
    EXPORTS
    
    vampGetPluginDescriptor           @1
    I just noticed that the function is in a file with the extension .cpp. So my guess is that I was previously compiling it as 'C' code but now I'm compiling as C++.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured