This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH,take2] Add plugin interface to LD, respun. [1..6/6]
- From: Richard Henderson <rth at redhat dot com>
- To: Dave Korn <dave dot korn dot cygwin at gmail dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 11 Oct 2010 10:22:48 -0700
- Subject: Re: [PATCH,take2] Add plugin interface to LD, respun. [1..6/6]
- References: <4CB2A71E.7000700@gmail.com>
On 10/10/2010 10:56 PM, Dave Korn wrote:
>
> Good morning Richard and list,
>
> I've respun all the LD plugin patches to fix the issues raised, rebased them
> up to more recent CVS HEAD, updated the ChangeLogs, and I've rebuilt and
> retested on i686-pc-cygwin and i686-pc-linux-gnu.
>
> I've also built but not tested (owing to lack of a compiler)
> mips-unknown-ecoff, alpha-unknown-linuxecoff, alpha-unknown-vms,
> pdp11-unknown-aout, rs6000-ibm-aix5.3.1 and i386-unknown-msdos to make sure
> I've at least not broken the build on ECOFF, XCOFF and AOUT targets.
>
> I think the one thing we didn't explicitly discuss was what to do with the
> symbol resolution stuff. I rewrote that based on the logic in
> gold/plugin.cc#Pluginobj::get_symbol_resolution_info(), so it should work
> correctly now on ELF as well as COFF and its derivatives.
>
> I plan to follow up shortly with a final patch to libldtl-ize the plugin
> loading, so that MinGW can work.
>
> Is it OK now to commit the entire series?
>
> cheers,
> DaveK
Without --enable-plugins:
../../git-binu/ld/ldmain.c: In function ‘add_archive_element’:
../../git-binu/ld/ldmain.c:800: error: unused variable ‘fildes’
../../git-binu/ld/ldmain.c:796: error: unused parameter ‘subsbfd’
which can be fixed in the obvious way.
With --enable-plugins (x86_64-linux):
libtool: link: gcc -shared .libs/libldtestplug_la-testplug.o -ldl ../libiberty/libiberty.a -Wl,-soname -Wl,libldtestplug.so.0 -o .libs/libldtestplug.so.0.0.0
/usr/bin/ld: ../libiberty/libiberty.a(xmalloc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
It may be easier to avoid libiberty in the test plugin than to
work out how to coordinate -fpic over there without libtool too.
For testing purposes, I just built the libiberty directory with
-fpic added manually. At which point I get
Running /local/rth/gcc/git-binu/ld/testsuite/ld-plugin/plugin.exp ...
ERROR: tcl error sourcing /local/rth/gcc/git-binu/ld/testsuite/ld-plugin/plugin.exp.
ERROR: couldn't save command result in variable
while executing
"catch "exec $NM tmpdir/func.o" nm_output"
invoked from within
"if { ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c tmpdir/main.o]
|| ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/func.c tmpdir/func.o]
|| ![ld_co..."
(file "/local/rth/gcc/git-binu/ld/testsuite/ld-plugin/plugin.exp" line 64)
invoked from within
"source /local/rth/gcc/git-binu/ld/testsuite/ld-plugin/plugin.exp"
("uplevel" body line 1)
invoked from within
"uplevel #0 source /local/rth/gcc/git-binu/ld/testsuite/ld-plugin/plugin.exp"
invoked from within
"catch "uplevel #0 source $test_file_name""
----
> ldfile_try_open_bfd (const char *attempt,
> lang_input_statement_type *entry)
> {
> +#ifdef ENABLE_PLUGINS
> + int fildes;
> +#endif /* ENABLE_PLUGINS */
Please move that down to the use and add { }.
r~