Skip to content

Commit ce0fe5c

Browse files
committed
linkerscripts added sort to preinit_array and fini_array
1 parent 757ff58 commit ce0fe5c

File tree

12 files changed

+48
-36
lines changed

12 files changed

+48
-36
lines changed

targets/chip/atsam3x8e/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ SECTIONS
8383
. = ALIGN(4);
8484
PROVIDE(__preinit_array_start = .);
8585

86-
KEEP(*(.preinit_array))
86+
KEEP(*(SORT(.preinit_array.*)))
87+
KEEP(*(SORT(.preinit_array)))
8788

8889
PROVIDE(__preinit_array_end = .);
8990
} > rom
@@ -94,7 +95,7 @@ SECTIONS
9495
PROVIDE(__init_array_start = .);
9596

9697
KEEP(*(SORT(.init_array.*)))
97-
KEEP(*(.init_array))
98+
KEEP(*(SORT(.init_array)))
9899

99100
PROVIDE(__init_array_end = .);
100101
} > rom
@@ -105,7 +106,7 @@ SECTIONS
105106
PROVIDE(__fini_array_start = .);
106107

107108
KEEP(*(SORT(.fini_array.*)))
108-
KEEP(*(.fini_array))
109+
KEEP(*(SORT(.fini_array)))
109110

110111
PROVIDE(__fini_array_end = .);
111112
} > rom

targets/chip/atsam4s2b/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ SECTIONS
8383
. = ALIGN(4);
8484
PROVIDE(__preinit_array_start = .);
8585

86-
KEEP(*(.preinit_array))
86+
KEEP(*(SORT(.preinit_array.*)))
87+
KEEP(*(SORT(.preinit_array)))
8788

8889
PROVIDE(__preinit_array_end = .);
8990
} > rom
@@ -94,7 +95,7 @@ SECTIONS
9495
PROVIDE(__init_array_start = .);
9596

9697
KEEP(*(SORT(.init_array.*)))
97-
KEEP(*(.init_array))
98+
KEEP(*(SORT(.init_array)))
9899

99100
PROVIDE(__init_array_end = .);
100101
} > rom
@@ -105,7 +106,7 @@ SECTIONS
105106
PROVIDE(__fini_array_start = .);
106107

107108
KEEP(*(SORT(.fini_array.*)))
108-
KEEP(*(.fini_array))
109+
KEEP(*(SORT(.fini_array)))
109110

110111
PROVIDE(__fini_array_end = .);
111112
} > rom

targets/chip/lpc1752/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ SECTIONS
9898
. = ALIGN(4);
9999
PROVIDE(__preinit_array_start = .);
100100

101-
KEEP(*(.preinit_array))
101+
KEEP(*(SORT(.preinit_array.*)))
102+
KEEP(*(SORT(.preinit_array)))
102103

103104
PROVIDE(__preinit_array_end = .);
104105
} > rom
@@ -109,7 +110,7 @@ SECTIONS
109110
PROVIDE(__init_array_start = .);
110111

111112
KEEP(*(SORT(.init_array.*)))
112-
KEEP(*(.init_array))
113+
KEEP(*(SORT(.init_array)))
113114

114115
PROVIDE(__init_array_end = .);
115116
} > rom
@@ -120,7 +121,7 @@ SECTIONS
120121
PROVIDE(__fini_array_start = .);
121122

122123
KEEP(*(SORT(.fini_array.*)))
123-
KEEP(*(.fini_array))
124+
KEEP(*(SORT(.fini_array)))
124125

125126
PROVIDE(__fini_array_end = .);
126127
} > rom

targets/chip/lpc1756/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ SECTIONS
9999
. = ALIGN(4);
100100
PROVIDE(__preinit_array_start = .);
101101

102-
KEEP(*(.preinit_array))
102+
KEEP(*(SORT(.preinit_array.*)))
103+
KEEP(*(SORT(.preinit_array)))
103104

104105
PROVIDE(__preinit_array_end = .);
105106
} > rom
@@ -110,7 +111,7 @@ SECTIONS
110111
PROVIDE(__init_array_start = .);
111112

112113
KEEP(*(SORT(.init_array.*)))
113-
KEEP(*(.init_array))
114+
KEEP(*(SORT(.init_array)))
114115

115116
PROVIDE(__init_array_end = .);
116117
} > rom
@@ -121,7 +122,7 @@ SECTIONS
121122
PROVIDE(__fini_array_start = .);
122123

123124
KEEP(*(SORT(.fini_array.*)))
124-
KEEP(*(.fini_array))
125+
KEEP(*(SORT(.fini_array)))
125126

126127
PROVIDE(__fini_array_end = .);
127128
} > rom

targets/chip/lpc1759/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ SECTIONS
102102
. = ALIGN(4);
103103
PROVIDE(__preinit_array_start = .);
104104

105-
KEEP(*(.preinit_array))
105+
KEEP(*(SORT(.preinit_array.*)))
106+
KEEP(*(SORT(.preinit_array)))
106107

107108
PROVIDE(__preinit_array_end = .);
108109
} > rom
@@ -113,7 +114,7 @@ SECTIONS
113114
PROVIDE(__init_array_start = .);
114115

115116
KEEP(*(SORT(.init_array.*)))
116-
KEEP(*(.init_array))
117+
KEEP(*(SORT(.init_array)))
117118

118119
PROVIDE(__init_array_end = .);
119120
} > rom
@@ -124,7 +125,7 @@ SECTIONS
124125
PROVIDE(__fini_array_start = .);
125126

126127
KEEP(*(SORT(.fini_array.*)))
127-
KEEP(*(.fini_array))
128+
KEEP(*(SORT(.fini_array)))
128129

129130
PROVIDE(__fini_array_end = .);
130131
} > rom

targets/chip/lpc1788/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ SECTIONS
8484
. = ALIGN(4);
8585
PROVIDE(__preinit_array_start = .);
8686

87-
KEEP(*(.preinit_array))
87+
KEEP(*(SORT(.preinit_array.*)))
88+
KEEP(*(SORT(.preinit_array)))
8889

8990
PROVIDE(__preinit_array_end = .);
9091
} > rom
@@ -95,7 +96,7 @@ SECTIONS
9596
PROVIDE(__init_array_start = .);
9697

9798
KEEP(*(SORT(.init_array.*)))
98-
KEEP(*(.init_array))
99+
KEEP(*(SORT(.init_array)))
99100

100101
PROVIDE(__init_array_end = .);
101102
} > rom
@@ -106,7 +107,7 @@ SECTIONS
106107
PROVIDE(__fini_array_start = .);
107108

108109
KEEP(*(SORT(.fini_array.*)))
109-
KEEP(*(.fini_array))
110+
KEEP(*(SORT(.fini_array)))
110111

111112
PROVIDE(__fini_array_end = .);
112113
} > rom

targets/chip/lpc55s66/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ SECTIONS
9292
. = ALIGN(4);
9393
PROVIDE(__preinit_array_start = .);
9494

95-
KEEP(*(.preinit_array))
95+
KEEP(*(SORT(.preinit_array.*)))
96+
KEEP(*(SORT(.preinit_array)))
9697

9798
PROVIDE(__preinit_array_end = .);
9899
} > rom
@@ -103,7 +104,7 @@ SECTIONS
103104
PROVIDE(__init_array_start = .);
104105

105106
KEEP(*(SORT(.init_array.*)))
106-
KEEP(*(.init_array))
107+
KEEP(*(SORT(.init_array)))
107108

108109
PROVIDE(__init_array_end = .);
109110
} > rom
@@ -114,7 +115,7 @@ SECTIONS
114115
PROVIDE(__fini_array_start = .);
115116

116117
KEEP(*(SORT(.fini_array.*)))
117-
KEEP(*(.fini_array))
118+
KEEP(*(SORT(.fini_array)))
118119

119120
PROVIDE(__fini_array_end = .);
120121
} > rom

targets/chip/lpc802/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ SECTIONS
8888
. = ALIGN(4);
8989
PROVIDE(__preinit_array_start = .);
9090

91-
KEEP(*(.preinit_array))
91+
KEEP(*(SORT(.preinit_array.*)))
92+
KEEP(*(SORT(.preinit_array)))
9293

9394
PROVIDE(__preinit_array_end = .);
9495
} > rom
@@ -99,7 +100,7 @@ SECTIONS
99100
PROVIDE(__init_array_start = .);
100101

101102
KEEP(*(SORT(.init_array.*)))
102-
KEEP(*(.init_array))
103+
KEEP(*(SORT(.init_array)))
103104

104105
PROVIDE(__init_array_end = .);
105106
} > rom
@@ -110,7 +111,7 @@ SECTIONS
110111
PROVIDE(__fini_array_start = .);
111112

112113
KEEP(*(SORT(.fini_array.*)))
113-
KEEP(*(.fini_array))
114+
KEEP(*(SORT(.fini_array)))
114115

115116
PROVIDE(__fini_array_end = .);
116117
} > rom

targets/chip/max32625/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ SECTIONS
8383
. = ALIGN(4);
8484
PROVIDE(__preinit_array_start = .);
8585

86-
KEEP(*(.preinit_array))
86+
KEEP(*(SORT(.preinit_array.*)))
87+
KEEP(*(SORT(.preinit_array)))
8788

8889
PROVIDE(__preinit_array_end = .);
8990
} > rom
@@ -94,7 +95,7 @@ SECTIONS
9495
PROVIDE(__init_array_start = .);
9596

9697
KEEP(*(SORT(.init_array.*)))
97-
KEEP(*(.init_array))
98+
KEEP(*(SORT(.init_array)))
9899

99100
PROVIDE(__init_array_end = .);
100101
} > rom
@@ -105,7 +106,7 @@ SECTIONS
105106
PROVIDE(__fini_array_start = .);
106107

107108
KEEP(*(SORT(.fini_array.*)))
108-
KEEP(*(.fini_array))
109+
KEEP(*(SORT(.fini_array)))
109110

110111
PROVIDE(__fini_array_end = .);
111112
} > rom

targets/chip/max32660/linkerscript.ld

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ SECTIONS
8383
. = ALIGN(4);
8484
PROVIDE(__preinit_array_start = .);
8585

86-
KEEP(*(.preinit_array))
86+
KEEP(*(SORT(.preinit_array.*)))
87+
KEEP(*(SORT(.preinit_array)))
8788

8889
PROVIDE(__preinit_array_end = .);
8990
} > rom
@@ -94,7 +95,7 @@ SECTIONS
9495
PROVIDE(__init_array_start = .);
9596

9697
KEEP(*(SORT(.init_array.*)))
97-
KEEP(*(.init_array))
98+
KEEP(*(SORT(.init_array)))
9899

99100
PROVIDE(__init_array_end = .);
100101
} > rom
@@ -105,7 +106,7 @@ SECTIONS
105106
PROVIDE(__fini_array_start = .);
106107

107108
KEEP(*(SORT(.fini_array.*)))
108-
KEEP(*(.fini_array))
109+
KEEP(*(SORT(.fini_array)))
109110

110111
PROVIDE(__fini_array_end = .);
111112
} > rom

0 commit comments

Comments
 (0)