This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ELIBBAD when linked with gold
- From: Ian Lance Taylor <iant at google dot com>
- To: Erwan Legrand <lists at erwanlegrand dot com>
- Cc: Cary Coutant <ccoutant at google dot com>, Binutils <binutils at sourceware dot org>
- Date: Fri, 1 Aug 2014 06:59:44 -0700
- Subject: Re: ELIBBAD when linked with gold
- Authentication-results: sourceware.org; auth=none
- References: <CA+4G5KZVD7eoEVw62amXu+ojxpZ7UJKY23=m5Brnbdxuub8_Ww at mail dot gmail dot com> <CAHACq4q+G3uMozqrBDMNED=Cz8Gec2pk+FN1hgUcZWheYF98VQ at mail dot gmail dot com> <CA+4G5Kb9bK1M7bOpfdAiJXFk0=FH8h1YsM+6L1d1Uv2r1nqr5w at mail dot gmail dot com>
On Fri, Aug 1, 2014 at 4:30 AM, Erwan Legrand <lists@erwanlegrand.com> wrote:
>
> It turns out one of the object files linked contains a .interp
> section. This comes from a generated C file which contains the
> following line:
> const char dadi_interp[] __attribute__((section(".interp"))) =
> "/lib/ld-linux.so.2";
>
> (I'm going to remove this line.)
>
> It turns out that in the case of ld.bfd, the -dynamic-linker command
> line parameter takes precedence over the .interp section in the object
> file and ld.gold behaviour's differ. I'd say that ld.bfd's behaviour
> is the more appropriate, i.e. command line args should take precedence
> over anything else.
This is a no-win situation. The linker shouldn't discard data from
input files, and it shouldn't ignore the -dynamic-linker option.
Probably the best thing would be to give an error.
Ian