This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gold --format incompatible with gnu ld


On 3/8/13, Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
>
> recently ran into a problem linking with gold
>   --> https://github.com/dvdhrm/kmscon/issues/83
>
> The issue at hand is that GNU ld accepts --format=default but gold
> doesn't. and GNU LD does not accept plain --format=elf so there is no
> generic solution.
>
> can gold be changed so "default" means "elf" or provides the same
> behavior as gnu ld ?

I didn't know --format=default worked.  Fixed for gold like so.
Committed to mainline.

Ian

2013-03-08  Ian Lance Taylor  <iant@google.com>

	* options.cc (General_options::string_to_object_format): Accept
	"default".
Index: options.cc
===================================================================
RCS file: /cvs/src/src/gold/options.cc,v
retrieving revision 1.118
diff -u -r1.118 options.cc
--- options.cc	15 Feb 2012 00:56:16 -0000	1.118
+++ options.cc	8 Mar 2013 22:31:38 -0000
@@ -652,7 +652,7 @@
 General_options::Object_format
 General_options::string_to_object_format(const char* arg)
 {
-  if (strncmp(arg, "elf", 3) == 0)
+  if (strncmp(arg, "elf", 3) == 0 || strcmp(arg, "default") == 0)
     return gold::General_options::OBJECT_FORMAT_ELF;
   else if (strcmp(arg, "binary") == 0)
     return gold::General_options::OBJECT_FORMAT_BINARY;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]