This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: Retreiving dynamic links through BFD


On Mon, May 24, 1999 at 02:15:01PM -0400, Ian Lance Taylor wrote:
>    I'm trying to decide if I feel brave enough to attempt this. =)  Are you 
>    thinking of something to the effect of:
> 
>    void bfd_fetch_shared_libs (bfd *, char **);
> 
>    This would put a pointer to an array of NULL-terminated strings in the 
>    second argument.
> 
> Yeah, but I would return a linked list of structs instead so that we
> could add more information than just the library name.  Also, it needs
> to return an indication of success or failure.

Then here's try #2:

struct bfd_shared_libs {
	char *libname;
};

boolean bfd_fetch_shared_libs (bfd *, int *, struct bfd_shared_libs *);

If this is correct, then I have more questions:

Is it okay to malloc() in bfd, knowing that the result will never be 
freed, or should I somehow expect the calling function to pre-malloc the 
space for me?

Is it safe to assume GNU realloc is being used (or something else that 
doesn't trash the contents of the array)?

Will you need paperwork from me for this patch when written?

Tks,
Jeff Bailey

-- 
I'm not a vegetarian because I love animals, I'm a vegetarian
because I hate plants.

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