[PATCH FIX] powerpc: discard .exit.data at runtime

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3947d

2 messages, 2 authors, 2015-10-15 · open the first message on its own page

[PATCH FIX] powerpc: discard .exit.data at runtime

From: Stephen Rothwell <hidden>
Date: 2015-10-07 23:28:28

.exit.text is discarded at run time and there are some references from
that to .exit.data, so we need to discard .exit.data at run time as well.

Fixes these errors:

`.exit.data' referenced in section `.exit.text' of drivers/built-in.o: defined in discarded section `.exit.data' of drivers/built-in.o
`.exit.data' referenced in section `.exit.text' of drivers/built-in.o: defined in discarded section `.exit.data' of drivers/built-in.o

Signed-off-by: Stephen Rothwell <redacted>
---
 arch/powerpc/kernel/vmlinux.lds.S | 6 ++++++
 1 file changed, 6 insertions(+)

I have only seen this with an allyesconfig build which fails for other
reasons.
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 1db685104ffc..d41fd0af8980 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -183,6 +183,12 @@ SECTIONS
 		*(.rela*)
 	}
 #endif
+	/* .exit.data is discarded at runtime, not link time,
+	 * to deal with references from .exit.text
+	 */
+	.exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) {
+		EXIT_DATA
+	}
 
 	/* freed after init ends here */
 	. = ALIGN(PAGE_SIZE);
-- 
2.5.3

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

Re: [FIX] powerpc: discard .exit.data at runtime

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-10-15 11:10:59

On Wed, 2015-07-10 at 23:28:28 UTC, Stephen Rothwell wrote:
.exit.text is discarded at run time and there are some references from
that to .exit.data, so we need to discard .exit.data at run time as well.

Fixes these errors:

`.exit.data' referenced in section `.exit.text' of drivers/built-in.o: defined in discarded section `.exit.data' of drivers/built-in.o
`.exit.data' referenced in section `.exit.text' of drivers/built-in.o: defined in discarded section `.exit.data' of drivers/built-in.o

Signed-off-by: Stephen Rothwell <redacted>
Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/4c8123181d692c5b78650ee5

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help