[PING] [rfc]: Framework for looking up multiply defined global symbols in shared libraries

Markus Deuling deuling@de.ibm.com
Tue Jun 5 03:46:00 GMT 2007


Hello,

Ulrich Weigand wrote:
> Markus Deuling wrote:
> 
> It looks like this duplicates a whole bunch of code from elf_locate_base.
> Maybe we should extract a helper routine that retrieves a given DT_ tag
> from the .dynamic section?
> 
> 
>> +/* Look up OBJFILE to BLOCK.  */
>> +
>> +struct objfile *
>> +lookup_objfile_from_block (const struct block *block)
> 
> I guess this could be static now.
> 
>> +/* Lookup objfile to a block.  */
>> +extern struct objfile *
>> +lookup_objfile_from_block (const struct block *block);
> 
> If we make it static, this should go away.  Otherwise, the function name
> should again not start in the first column for the prototype.
> 
> 
> Bye,
> Ulrich
> 

thank you very much for your input. I reworked the patch. There is now a helper routine to extract DT_ tags from
.dynamic section called scan_dyntag. Testsuite on x86 showed no regression.

Is this ok to commit?

ChangeLog:

	* cp-namespace.c (lookup_symbol_file): Add block to
	lookup_symbol_global call.
	* Makefile.in (solist_h): Add dependency on symtab header.
	(solib.o): Add dependency on objfiles header.
	(symtab.o): Add dependency on solist header.
	* solib.c (solib_global_lookup): New function.
	* solib-svr4.c (scan_dyntag): Likewise.
	(elf_locate_base): Call helper routine scan_dyntag.
	(elf_lookup_lib_symbol): New function.
	(_initialize_svr4_solib): Add elf_lookup_lib_symbol to svr4_so_ops.
	* solist.h (symtab.h): New include.
	(lookup_lib_global_symbol): New prototype.
	(solib_global_lookup): Likewise.
	* symtab.c: New include solist.h.
	(lookup_objfile_from_block): New function.
	(lookup_global_symbol_from_objfile): New function.
	(basic_lookup_symbol_nonlocal): Add block to lookup_symbol_global call.
	(lookup_symbol_global): Call library-specific lookup procedure.
	* symtab.h (lookup_global_symbol_from_objfile): New prototype.
	* gdb.base/libmd.c: New file (testcase multiple symbol lookup).
	* gdb.base/libmd.h: Likewise.
	* gdb.base/solib_symbol.c: Likewise.
	* gdb.base/solib_symbol.exp: Likewise.

-- 
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff-gdb-multiple-symbols-mainline
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20070605/71eaa31f/attachment.ksh>


More information about the Gdb-patches mailing list