This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bfd patch for gdb cross-debugging support


Danny Backx <danny.backx@scarlet.be> writes:

> On Mon, 2009-09-14 at 09:08 -0700, Ian Lance Taylor wrote:
>> Aside from API issues, I will note that using a global variable is not
>> an ideal choice when BFD is compiled as a shared library.
>
> You're implying that I extend some existing data structure with a field.
> Is this structure the "struct bfd" ?

No, sorry, I'm implying that you should use a static variable with a
function API.  Much as you understood before.  Sorry for the confusion.

(There is nothing wrong with global or static variables referenced only
within a shared library.  Having the main program refer to a global
variable defined in a shared library works, but has various issues I
won't go into here.  The latter is best avoided when possible.)

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]