Files
s390-tools/zipl/boot/head.S
Marc Hartmayer 3d168fac14 zipl/boot: declare that no executable stack is required
Normally, `gcc` takes care of adding the `GNU_STACK` marking except for
assembly code. Therefore, let's add the marking manually. Discard the
`.note.GNU-stack` section in the linker script since it's just a
"message" from the compiler to the linker. This fixes the linker
warning:

ld: warning: entry.o: missing .note.GNU-stack section implies executable stack

Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-02-13 22:18:49 +01:00

36 lines
973 B
ArmAsm

/*
* zipl - zSeries Initial Program Loader tool
*
* Entry code for stage 2 and stage 3 boot loader
*
* Copyright IBM Corp. 2013, 2017
*
* s390-tools is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/
#include "boot/sigp.h"
.section .text.start
.globl _start
_start:
basr %r13,0
0: la %r7,2 /* First try code 2: */
la %r6,0 /* 64 bit psws are restored */
sigp %r7,%r6,SIGP_SET_ARCHITECTURE /* Switch to 64 bit */
bc 8,.Lswitched_64-0b(%r13) /* Accepted ? */
la %r7,1 /* Failed - try code 1 */
sigp %r7,%r6,SIGP_SET_ARCHITECTURE /* Switch to 64 bit */
.Lswitched_64:
sam64 /* Switch to 64 bit addr mode */
basr %r13,0
1: llgf %r15,.Lstack-1b(%r13) /* End of stack */
brasl %r14,initialize
.Lstack: .long 0x10000-160
.previous
/* The code doesn't require an executable stack */
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif