bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/12914] New: dllwrap creates wrong DLLs with repeated fixup


From: anpaza at mail dot ru
Subject: [Bug binutils/12914] New: dllwrap creates wrong DLLs with repeated fixups for same address
Date: Mon, 20 Jun 2011 14:59:56 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=12914

           Summary: dllwrap creates wrong DLLs with repeated fixups for
                    same address
           Product: binutils
           Version: 2.20
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: address@hidden
        ReportedBy: address@hidden


Sometimes dllwrap generates relocation tables which contain multiple entries
for same address. This leads to fixups being applied TWICE, and then, most
likely, to a fault. This problem is not noticeable if DLL loads to the "desired
base address", but instantly pops up if the desired address is occupied by
other library.

Testcase: create a sinle file named test.c:

--------------------------------
int x;

__declspec (dllexport) int test ()
{
  x = 0;
  return 1;
}
--------------------------------

Now create a DLL from it:

i686-pc-mingw32-gcc -c test.c
i686-pc-mingw32-dllwrap -o test.dll test.o

Now examine its relocation table:

i686-pc-mingw32-objdump --all test.dll |less

(for some reason objdump -r does not display relocations, but with --all it
does).

Now navigate to relocation table and see:

Virtual Address: 00001000 Chunk size 88 (0x58) Number of fixups 40
    reloc    0 offset    d [100d] HIGHLOW
    reloc    1 offset   15 [1015] HIGHLOW
    reloc    2 offset   3d [103d] HIGHLOW
    reloc    3 offset   45 [1045] HIGHLOW
    reloc    4 offset   69 [1069] HIGHLOW
    reloc    5 offset   73 [1073] HIGHLOW
    reloc    6 offset   88 [1088] HIGHLOW
[... skipped ...]
Virtual Address: 00001000 Chunk size 84 (0x54) Number of fixups 38
    reloc    0 offset    d [100d] HIGHLOW
    reloc    1 offset   15 [1015] HIGHLOW
    reloc    2 offset   3d [103d] HIGHLOW
    reloc    3 offset   45 [1045] HIGHLOW
    reloc    4 offset   69 [1069] HIGHLOW
    reloc    5 offset   73 [1073] HIGHLOW
    reloc    6 offset   88 [1088] HIGHLOW

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]