bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/19541] Format reader for ILF format (used by MSVC-generated impo


From: njs at pobox dot com
Subject: [Bug ld/19541] Format reader for ILF format (used by MSVC-generated import libraries) does not properly handle data imports
Date: Sun, 31 Jan 2016 20:05:48 +0000

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

--- Comment #3 from Nathaniel J. Smith <njs at pobox dot com> ---
Created attachment 8946
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8946&action=edit
Tiny ILF file with DATA symbol for testing

Attaching an example ILF-format import member, extracted from a 32-bit
python27.lib (as created by MSVC, and distributed in the python.org official
python 2.7 windows downloads).

Without the patch, nm on this file shows no symbols; after the patch, it
correctly shows a reference to __imp___Py_NoneStruct. Also, here's a simple
test case:

---- nonestruct-test.c ----

__declspec(dllimport) struct PyObject_Struct _Py_NoneStruct;
struct PyObject_Struct *f()
{
    return &_Py_NoneStruct;
}

---- end nonestruct-test.c ----

Without the patch, linking this program to export-_Py_NoneStruct.o fails with:

  undefined reference to `_imp___Py_NoneStruct'

but with the patch, linking succeeds and correctly creates an import table
referencing _Py_NoneStruct.

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