Building EFI binaries, particularly larger ones (like e.g. Xen does), on Linux

(where relocatable objects are in ELF format) so far led to all local (aka
static) symbols to be discarded, making debugging quite a bit more difficult
(like Linux, Xen builds an internal symbol lookup table from nm output
generated on the binary produced by an earlier linking pass). Therefore, this
patch arranges to insert all (relevant) local symbols from non-COFF objects
into the final executable's symbol table between those coming from COFF input
files and the global ones.

bfd/
2011-11-02  Jan Beulich  <jbeulich@suse.com>

	* coffgen.c (coff_write_alien_symbol): Make public. Add 'struct
	internal_syment *' parameter. Extend 'dummy' to an array with two
	elements. Set n_numaux early. Handle BSF_FILE.
	(coff_write_symbols): Pass NULL as new third argument to
	coff_write_alien_symbol().
	* cofflink.c (_bfd_coff_final_link): Don't use COFF-specific
	obj_raw_syment_count() on non-COFF input BFD. Insert local symbols
	from non-COFF input BFDs.
	* libcoff-in.h (coff_write_alien_symbol): Declare.
	* libcoff.h (coff_write_alien_symbol): Re-generate.
This commit is contained in:
Jan Beulich
2011-11-02 14:53:04 +00:00
parent 207d428dce
commit e7ebb21483
5 changed files with 131 additions and 10 deletions

View File

@ -322,6 +322,9 @@ extern void coff_mangle_symbols
(bfd *);
extern bfd_boolean coff_write_symbols
(bfd *);
extern bfd_boolean coff_write_alien_symbol
(bfd *, asymbol *, struct internal_syment *, bfd_vma *,
bfd_size_type *, asection **, bfd_size_type *);
extern bfd_boolean coff_write_linenumbers
(bfd *);
extern alent *coff_get_lineno