-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for __attribute__((section(".data"))) (#18)
- Loading branch information
Showing
20 changed files
with
120 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- config/mips/mips.h 1993-11-15 06:54:12.000000000 +0000 | ||
+++ config/mips/mips-patched.h 2023-11-14 22:48:19.932635363 +0000 | ||
@@ -545,8 +545,8 @@ | ||
/* Names to predefine in the preprocessor for this target machine. */ | ||
|
||
#ifndef CPP_PREDEFINES | ||
-#define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_BSD43 \ | ||
--D_mips -D_unix -D_host_mips -D_MIPSEB -D_R3000 -D_SYSTYPE_BSD43 \ | ||
+#define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEL -DR3000 -DSYSTYPE_BSD43 \ | ||
+-D_mips -D_unix -D_host_mips -D_MIPSEL -D_R3000 -D_SYSTYPE_BSD43 \ | ||
-Asystem(unix) -Asystem(bsd) -Acpu(mips) -Amachine(mips)" | ||
#endif | ||
|
||
@@ -881,6 +881,11 @@ | ||
*/ | ||
#define BITS_BIG_ENDIAN 0 | ||
|
||
+/* Force little-endian */ | ||
+#define MIPSEL | ||
+#define BYTES_BIG_ENDIAN 0 | ||
+#define WORDS_BIG_ENDIAN 0 | ||
+ | ||
/* Define this if most significant byte of a word is the lowest numbered. */ | ||
#ifndef BYTES_BIG_ENDIAN | ||
#ifndef DECSTATION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,35 @@ | ||
--- mips.h 1995-06-15 19:32:41.000000000 +0000 | ||
+++ mips-patched.h 2023-10-04 09:29:22.998515730 +0000 | ||
--- config/mips/mips.h 1995-06-15 19:32:41.000000000 +0000 | ||
+++ config/mips/mips-patched.h 2023-11-14 22:31:00.506591160 +0000 | ||
@@ -406,6 +406,9 @@ | ||
| TARGET_ENDIAN_DEFAULT)} \ | ||
} | ||
|
||
+/* Default little-endian */ | ||
+#define TARGET_ENDIAN_DEFAULT -MASK_BIG_ENDIAN | ||
+ | ||
/* Default target_flags if no switches are specified */ | ||
|
||
#ifndef TARGET_DEFAULT | ||
@@ -954,6 +957,22 @@ | ||
#define ASM_OUTPUT_DESTRUCTOR(file, name) | ||
|
||
#endif /* 0 */ | ||
+ | ||
+/* A C statement to output something to the assembler file to switch to section | ||
+ NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or | ||
+ NULL_TREE. Some target formats do not support arbitrary sections. Do not | ||
+ define this macro in such cases. */ | ||
+ | ||
+#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME) \ | ||
+do { \ | ||
+ extern FILE *asm_out_text_file; \ | ||
+ if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \ | ||
+ fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \ | ||
+ else if ((DECL) && TREE_READONLY (DECL)) \ | ||
+ fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME)); \ | ||
+ else \ | ||
+ fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME)); \ | ||
+} while (0) | ||
|
||
/* Target machine storage layout */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- config/mips/mips.h 1997-12-29 00:34:57.000000000 +0000 | ||
+++ config/mips/mips-patched.h 2023-11-14 22:29:18.785172634 +0000 | ||
@@ -441,6 +441,9 @@ | ||
| TARGET_ENDIAN_DEFAULT)} \ | ||
} | ||
|
||
+/* Default little-endian */ | ||
+#define TARGET_ENDIAN_DEFAULT -MASK_BIG_ENDIAN | ||
+ | ||
/* Default target_flags if no switches are specified */ | ||
|
||
#ifndef TARGET_DEFAULT | ||
@@ -1153,6 +1156,22 @@ | ||
#define ASM_OUTPUT_DESTRUCTOR(file, name) | ||
|
||
#endif /* 0 */ | ||
+ | ||
+/* A C statement to output something to the assembler file to switch to section | ||
+ NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or | ||
+ NULL_TREE. Some target formats do not support arbitrary sections. Do not | ||
+ define this macro in such cases. */ | ||
+ | ||
+#define ASM_OUTPUT_SECTION_NAME(F, DECL, NAME, RELOC) \ | ||
+do { \ | ||
+ extern FILE *asm_out_text_file; \ | ||
+ if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL) \ | ||
+ fprintf (asm_out_text_file, "\t.section %s,\"ax\",@progbits\n", (NAME)); \ | ||
+ else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC)) \ | ||
+ fprintf (F, "\t.section %s,\"a\",@progbits\n", (NAME)); \ | ||
+ else \ | ||
+ fprintf (F, "\t.section %s,\"aw\",@progbits\n", (NAME)); \ | ||
+} while (0) | ||
|
||
/* Target machine storage layout */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
int some_var __attribute__((section(".data"))) = 100; |