bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/20675] [metag] internal error cross-compiling static programs


From: nickc at redhat dot com
Subject: [Bug ld/20675] [metag] internal error cross-compiling static programs
Date: Mon, 14 Nov 2016 14:14:30 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=20675

--- Comment #5 from Nick Clifton <nickc at redhat dot com> ---
Created attachment 9629
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9629&action=edit
Proposed patch

Hi Wbx,

  Thanks very much.  I can now reproduce the problem, although I am not sure
now it should be resolved.  At issue is the fact that the libc.a library
contains relocations that set up entries in the PLT, but the PLT is only used
when creating a dynamic executable, not a static one.  You are linking with
"-static" specified on the command line, so clearly the intent is to create a
static executable.

  There is a bug in the linker, in that it should have produced an informative
error message and then exited with a non-zero return code, rather than calling
abort.  But I do not think that the linker is doing anything fundamentally
wrong.  You are asking it to create a static executable, but giving it shared
libraries to link.  The real bug, IMHO, is the creation of what appears to be a
static library - libc.a - but which actually contains shared library code.

  The uploaded patch will fix the linker, so that an error message like this is
displayed:

  ld:./libc.a(herrno.os)(.text): shared library symbol _h_errno encountered
whilst performing a static link
  ld: final link failed: Nonrepresentable section on output

If you are happy with this change then I will check it in.  I am not sure
however what should be done about libc.a.  I think that you need to investigate
how it was created in the first place.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]