Thread: MinGW & IMAGE_LOAD_CONFIG_DIRECTORY

  1. #1
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    632

    MinGW & IMAGE_LOAD_CONFIG_DIRECTORY

    Anybody know how/if you can get MinGW GCC to add one of these things to the exe header?

    In Visual Studio you do this

    Code:
    extern IMAGE_LOAD_CONFIG_DIRECTORY _load_config_used = {
        0x24, // fill these with whatever
        0x12345678
    };
    And the VS linker knows to look for _load_config_used and does the bizzo, filling in the IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG PE optional header directory with a pointer to it. MinGW doesn't know the magic name, or at least doesn't do anything special with it, so if its possible there's some other method to achieve it.

    I can use assembly if there are ways to make AS/GAS do it directly.

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    632
    As some closure:

    There no automation of this
    LD's plugin system is basically useless for anything other than the one purpose it was invented for, so you can't write a plugin to do it
    Linker scripts can write the exe header details, but they can only produce new symbols to link to, not read vslues or addresses of existing ones so that's no good either

    Essentially you have to produce a map file, parse that and then edit the exe header yourself. Not the biggest job known to mankind but disappointing that there's no ability for a self-contained solution

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SDL and mingw. Please help.
    By Erin100280 in forum C++ Programming
    Replies: 2
    Last Post: 08-15-2010, 09:26 PM
  2. mingw-32, where are you?
    By tja52 in forum C++ Programming
    Replies: 5
    Last Post: 11-25-2009, 11:58 PM
  3. Mingw
    By brconner in forum Windows Programming
    Replies: 8
    Last Post: 07-10-2007, 11:53 AM
  4. Mingw
    By anirban in forum C++ Programming
    Replies: 4
    Last Post: 04-17-2007, 07:29 AM
  5. mingw help
    By DarkDot in forum Tech Board
    Replies: 17
    Last Post: 04-16-2007, 11:25 PM

Tags for this Thread