summaryrefslogtreecommitdiff
path: root/testing/source/binutils/patches/binutils-2.24-ldforcele.patch
blob: 194cf1ea9aaaa9ce08e6273f5954964b29560479 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Common subdirectories: ../binutils-2.24.orig/ld/emulparams and ld/emulparams
Common subdirectories: ../binutils-2.24.orig/ld/emultempl and ld/emultempl
diff -up ../binutils-2.24.orig/ld/ldlang.c ld/ldlang.c
--- a/ld/ldlang.c	2014-05-09 10:35:04.589504928 +0100
+++ b/ld/ldlang.c	2014-05-09 10:35:55.515661478 +0100
@@ -7096,6 +7096,18 @@
 	       && little != NULL)
 	format = little;
 
+      if (getenv ("LD_FORCE_LE") != NULL)
+	{
+	  if (strcmp (format, "elf64-powerpc") == 0)
+	    format = "elf64-powerpcle";
+	  else if (strcmp (format, "elf32-powerpc") == 0)
+	    format = "elf32-powerpcle";
+	  else if (strcmp (format, "elf64-big") == 0)
+	    format = "elf64-little";
+	  else if (strcmp (format, "elf32-big") == 0)
+	    format = "elf32-little";
+	}
+
       output_target = format;
     }
 }
Only in ld: ldlang.c.orig
diff -up ../binutils-2.24.orig/ld/ldmain.c ld/ldmain.c
--- a/ld/ldmain.c	2014-05-09 10:35:04.593504941 +0100
+++ b/ld/ldmain.c	2014-05-09 10:35:55.515661478 +0100
@@ -603,6 +603,18 @@
 	}
     }
 
+  if ((strncmp (emulation, "elf64ppc", 8) == 0
+       || strncmp (emulation, "elf32ppc", 8) == 0)
+      && getenv ("LD_FORCE_LE") != NULL)
+    {
+      size_t len = strlen (emulation);
+      char *le = xmalloc (len + 2);
+      memcpy (le, emulation, 5);
+      le[5] = 'l';
+      memcpy (le + 6, emulation + 5, len - 4);
+      emulation = le;
+    }
+
   return emulation;
 }
 
Only in ld: ldmain.c.orig
Common subdirectories: ../binutils-2.24.orig/ld/ldscripts and ld/ldscripts
Common subdirectories: ../binutils-2.24.orig/ld/.libs and ld/.libs
Common subdirectories: ../binutils-2.24.orig/ld/po and ld/po
Common subdirectories: ../binutils-2.24.orig/ld/scripttempl and ld/scripttempl
Common subdirectories: ../binutils-2.24.orig/ld/testsuite and ld/testsuite
Common subdirectories: ../binutils-2.24.orig/ld/tmpdir and ld/tmpdir