Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-6504

[LD BUG] Delay import library combined with __declspec(dllimport) produces bogus output files

    XMLWordPrintable

Details

    Description

      Using a delay import library with functions which are declared in their header files as __declspec(dllimport) (e.g. ws2_32 functions) fails.
      This will cause a run-time failure when any such function is called, by jumping to the address '6'.

      This is a bug in binutils.

      A detailed test case can be found at:
      https://home.tfaber.net/~thfabba/pub/delaylib/

      Workarounds include:

      • linking the individual object files from the delay import lib
      • not using __declspec(dllimport) on such functions
      • (untested) referencing the function(s) in question at least once without using the dllimport attribute

      This has been tested with RosBE's binutils (2.20.51.20091222). Tests with later versions to come...

      Attachments

        Issue Links

          Activity

            People

              bug zilla Bug Zilla
              ThFabba ThFabba
              Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated: