Skip to content

Commit 242bbf1

Browse files
timschumilinusg
authored andcommitted
Toolchain: Set '/' as default division character for binutils
While we are at it, regenerate the patch and remove some outdated parts of the description.
1 parent 9aafaec commit 242bbf1

File tree

1 file changed

+37
-18
lines changed

1 file changed

+37
-18
lines changed

Toolchain/Patches/binutils.patch

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
From e80a89e9446501bcaf42dc8ade8ff8a1cd0458bb Mon Sep 17 00:00:00 2001
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Daniel Bertalan <dani@danielbertalan.dev>
33
Date: Thu, 10 Feb 2022 17:49:12 +0100
44
Subject: [PATCH] Add support for SerenityOS
55

66
Teaches the assembler, BFD, and the linker about the SerenityOS target
77
triple.
8-
9-
On x86_64, we override the default base address of non-PIE executables,
10-
because the default (0x400000) is too close to the beginning of the
11-
address space, and DynamicLoader often ends up allocating internal data
12-
at that address. See commit 292398b5857d0104f7c33fdb5d79f45fe8b395dd.
138
---
14-
bfd/config.bfd | 15 +++++++++++++++
15-
gas/configure.tgt | 2 ++
16-
ld/Makefile.am | 1 +
17-
ld/Makefile.in | 1 +
18-
ld/configure.tgt | 9 +++++++++
19-
ld/emulparams/elf_x86_64_serenity.sh | 2 ++
20-
6 files changed, 30 insertions(+)
21-
create mode 100644 ld/emulparams/elf_x86_64_serenity.sh
9+
bfd/config.bfd | 15 +++++++++++++++
10+
gas/config/tc-i386.c | 3 ++-
11+
gas/config/te-serenity.h | 3 +++
12+
gas/configure.tgt | 2 ++
13+
ld/Makefile.am | 1 +
14+
ld/Makefile.in | 1 +
15+
ld/configure.tgt | 9 +++++++++
16+
7 files changed, 33 insertions(+), 1 deletion(-)
17+
create mode 100644 gas/config/te-serenity.h
2218

2319
diff --git a/bfd/config.bfd b/bfd/config.bfd
2420
index cfe58247..9a10e011 100644
@@ -60,23 +56,46 @@ index cfe58247..9a10e011 100644
6056
#endif
6157
i[3-7]86-*-lynxos*)
6258
targ_defvec=i386_elf32_vec
59+
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
60+
index e0632681..4e9ba9fd 100644
61+
--- a/gas/config/tc-i386.c
62+
+++ b/gas/config/tc-i386.c
63+
@@ -481,7 +481,8 @@ const char extra_symbol_chars[] = "*%-([{}"
64+
&& !defined (TE_Haiku) \
65+
&& !defined (TE_FreeBSD) \
66+
&& !defined (TE_DragonFly) \
67+
- && !defined (TE_NetBSD))
68+
+ && !defined (TE_NetBSD) \
69+
+ && !defined (TE_SerenityOS))
70+
/* This array holds the chars that always start a comment. If the
71+
pre-processor is disabled, these aren't very useful. The option
72+
--divide will remove '/' from this list. */
73+
diff --git a/gas/config/te-serenity.h b/gas/config/te-serenity.h
74+
new file mode 100644
75+
index 00000000..f38faf59
76+
--- /dev/null
77+
+++ b/gas/config/te-serenity.h
78+
@@ -0,0 +1,3 @@
79+
+#include "te-generic.h"
80+
+
81+
+#define TE_SerenityOS 1
6382
diff --git a/gas/configure.tgt b/gas/configure.tgt
64-
index 62f806bd..cfc93df9 100644
83+
index 62f806bd..67ca2445 100644
6584
--- a/gas/configure.tgt
6685
+++ b/gas/configure.tgt
6786
@@ -134,6 +134,7 @@ case ${generic_target} in
6887
aarch64*-linux-gnu_ilp32) arch=aarch64:32 ;;
6988
esac ;;
7089
aarch64*-*-netbsd*) fmt=elf em=nbsd;;
71-
+ aarch64*-*-serenity*) fmt=elf ;;
90+
+ aarch64*-*-serenity*) fmt=elf em=serenity ;;
7291

7392
alpha-*-*vms*) fmt=evax ;;
7493
alpha-*-osf*) fmt=ecoff ;;
7594
@@ -263,6 +264,7 @@ case ${generic_target} in
7695
i386-*-*nt*) fmt=coff em=pe ;;
7796
i386-*-rdos*) fmt=elf ;;
7897
i386-*-darwin*) fmt=macho ;;
79-
+ i386-*-serenity) fmt=elf ;;
98+
+ i386-*-serenity) fmt=elf em=serenity ;;
8099

81100
ia16-*-elf*) fmt=elf ;;
82101

@@ -105,7 +124,7 @@ index 61e93eea..8b9ee2cf 100644
105124
ehppa64linux.c \
106125
ei386pep.c \
107126
diff --git a/ld/configure.tgt b/ld/configure.tgt
108-
index c7acf3f1..19982e51 100644
127+
index c7acf3f1..d34b9ea3 100644
109128
--- a/ld/configure.tgt
110129
+++ b/ld/configure.tgt
111130
@@ -59,6 +59,9 @@ aarch64-*-freebsd*) targ_emul=aarch64fbsd

0 commit comments

Comments
 (0)