bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/30139] Incorrect ordinal numbers for aliased symbols in DE


From: pali at kernel dot org
Subject: [Bug binutils/30139] Incorrect ordinal numbers for aliased symbols in DEF file
Date: Tue, 14 May 2024 22:50:40 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=30139

Pali Rohár <pali at kernel dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nickc at redhat dot com

--- Comment #2 from Pali Rohár <pali at kernel dot org> ---
Some corrections.

By default (unless NONAME is not specified in def file), import library imports
symbol by name+hint (not by ordinal), .exe file imports by what is in import
library, hence in this case by name+hint too.

With recent changes in objdump (from bug #31738) to correctly shows ordinals
and hints, now for the example from the description it shows:

$ objdump -p test-ordinal.exe | grep -A 4 library.dll
        DLL Name: library.dll
        vma:     Ordinal  Hint  Member-Name  Bound-To
        00008388  <none>  0002  function
        00008390  <none>  0001  function


So in the description of the bug report for provided example should have been
written that incorrect HINT number was generated.


Anyway, the problem is also for the exports by ordinals. Example is with the
same commands and files as in the bug description, just the symbol "function"
in the def file has "NONAME" keyword specified.

$ cat library.def
LIBRARY "library.dll"
EXPORTS
function @1 NONAME
alias NONAME == function

For this example the objdump prints:

objdump -p test-ordinal.exe | grep -A 4 library.dll
        DLL Name: library.dll
        vma:     Ordinal  Hint  Member-Name  Bound-To
        00008388      2  <none> <none>
        00008390      1  <none> <none>


And this is a bug as in the def file there is no symbol with ordinal 2
specified. The application call / reference just the symbol "function" which
has ordinal number 1.

Wrong hint number is not a big issue (it just cause slower loading of
application as the PE loader has to scan whole export table). But wrong ordinal
number is a serious bug as it cause that application calls different function
than it should.

-- 
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]