Alexander Friedman wrote:
>>Yeah, you don't want anything like BFD.
>>
>>
>>
>>>Here's some things I've discovered so far and associated
questions:
>>>
>>>1) We're really only interested in a writing interface to create
the
>>>object files. If we get that right we can use dlsym and friends to
do
>>>the reading (loading/linking).
>>>
>>>Does everyone agree that we don't need a "reading"
interface?
>>>
>>>
>>Yes, we only want writing. Reading is something that is completely
>>orthogonal to anything the backend will want.
>>
>>
>
>Wouldn't it be nice to have a common way to load files on both windows
>and unix platforms? Otherwise users will have to write their own
>version that does either dlopen or the windows equivelent based on the
>os. Perhaps using libelf we could temporarily load .elf files on
>windows, untill there is a coff writer. Later we could change the
>implementation to produce COFF without changing any interface.
>
LLVM already has a platform-independent interface for dynamically
loading libraries in lib/System for its own use. As for users, it's not
the purpose of LLVM to abstract away operating system APIs. After all,
why stop with loading libraries? Why not file I/O, or networking,
mutexes, or even GUIs?