On 29/10/2010 02:31, Ian Lance Taylor wrote: > This implements an object file reader/writer which does everything > required by LTO and gccgo. The ELF code works. I have not tested the > Mach-O and COFF code at all beyond compiling it; I hope that somebody > else can test those targets and fix them. > > With this patch, libelf is no longer needed. Almost, but not quite! The attached patch switches the lto-plugin over to use the new objfile reader as well. lto-plugin/ChangeLog: * configure.ac: Don't use libelf, don't source config.gcc. (LIBELFLIBS): Delete. (LIBELFINC): Delete. (LTO_FORMAT): Delete. (SYM_STYLE): New AC_SUBST var set based on $target. * Makefile.am (LIBELFLIBS): Delete. (LIBELFINC): Delete. (LTO_FORMAT): Delete. (SYM_STYLE): Import. (AM_CPPFLAGS): Use it. Don't use LIBELFINC. (liblto_plugin_la_SOURCES): Don't use LTO_FORMAT, don't include any object-format-specific source file in the link. (liblto_plugin_la_LIBADD): Don't use LIBELFLIBS. * configure: Regenerate. * Makefile.in: Regenerate. * lto-plugin-elf.c: Delete. * lto-plugin-coff.c: Delete. * lto-plugin.h: Delete. * lto-plugin.c (O_BINARY): Definition moved here from lto-plugin.h. (LTO_SEGMENT_NAME): New definition. (LTO_SECTION_PREFIX): Definition moved here from lto-plugin.h. (LTO_SECTION_PREFIX_LEN): New definition. (struct sym_aux): Struct definition moved here from lto-plugin.h. (struct plugin_symtab): Likewise. (struct plugin_objfile): Likewise. (struct plugin_objfile): New struct def. (enum symbol_style): New enum type. (add_symbols): Make static. (claimed_files): Likewise. (num_claimed_files): Likewise. (sym_style): New global. (check): Make static. (parse_table_entry): Likewise. Respect sym_style when extracting symbol from symtab entry. (translate): Make static. (resolve_conflicts): Likewise. (process_symtab): New function, per-section callback version of old object-format-specific handling from deleted lto-plugin-elf.c. (claim_file_handler): Convert ELF-specific version from deleted lto-plugin-elf.c to objfile interface and move here. (process_options): Allow new '-sym-style=' option. (onload): Don't call deleted onload_format_checks hook. Bootstrapped and tested all languages except java and ada on x86_64-unknown-linux-gnu, no regressions. There are still a couple of bugs to iron out of the COFF-specific part of the objfile reader which I'll have fixed later today. OK for trunk (once the objfile changes have gone in)? cheers, DaveK