File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,19 +42,6 @@ SECTIONS
4242 *(.rodata.*)
4343 _erodata = . ;
4444 }
45- .rel.dyn : {
46- *(.rel.*)
47- }
48- .rela.dyn : {
49- *(.rela.*)
50- }
51- .got : {
52- *(.got)
53- }
54- .got.plt : {
55- *(.got.plt)
56- }
57-
5845 .data : {
5946 _data = . ;
6047 *(.data )
@@ -85,13 +72,34 @@ SECTIONS
8572 ELF_DETAILS
8673
8774 DISCARDS
88- }
8975
90- ASSERT(SIZEOF(.got) == 0 , "Unexpected GOT entries detected!" )
76+ .got.plt (INFO) : {
77+ *(.got.plt)
78+ }
79+ ASSERT(SIZEOF(.got.plt) == 0 ||
9180#ifdef CONFIG_X86_64
92- ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18 , "Unexpected GOT/PLT entries detected!" )
81+ SIZEOF(.got.plt) == 0x18 ,
9382#else
94- ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0xc , "Unexpected GOT/PLT entries detected!" )
83+ SIZEOF(.got.plt) == 0xc ,
9584#endif
85+ "Unexpected GOT/PLT entries detected!" )
86+
87+ /*
88+ * Sections that should stay zero sized, which is safer to
89+ * explicitly check instead of blindly discarding.
90+ */
91+ .got : {
92+ *(.got)
93+ }
94+ ASSERT(SIZEOF(.got) == 0 , "Unexpected GOT entries detected!" )
95+
96+ .rel.dyn : {
97+ *(.rel.*)
98+ }
99+ ASSERT(SIZEOF(.rel.dyn) == 0 , "Unexpected run-time relocations (.rel) detected!" )
96100
97- ASSERT(SIZEOF(.rel.dyn) == 0 && SIZEOF(.rela.dyn) == 0 , "Unexpected run-time relocations detected!" )
101+ .rela.dyn : {
102+ *(.rela.*)
103+ }
104+ ASSERT(SIZEOF(.rela.dyn) == 0 , "Unexpected run-time relocations (.rela) detected!" )
105+ }
You can’t perform that action at this time.
0 commit comments