@@ -19,6 +19,7 @@
#include <sysdep.h>
+ .section .text.startup
ENTRY (_start)
/* Create an initial frame with 0 LR and FP */
cfi_undefined (x30)
@@ -59,7 +59,7 @@
NULL
*/
- .text
+ .section .text.startup
ENTRY(_start)
/* Create an initial frame with 0 LR and FP */
cfi_undefined (x30)
@@ -135,7 +135,7 @@ elf_machine_runtime_setup (struct link_map *map, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START asm ("\
- .section .text \n\
+ .section .text.startup \n\
.set at \n\
.globl _start \n\
.ent _start \n\
@@ -35,7 +35,7 @@
#include <sysdep.h>
- .text
+ .section .text.startup
.align 3
.globl _start
.ent _start, 0
@@ -153,7 +153,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
-calls into app main with address of finaliser. */
#define RTLD_START asm ("\
-.text \n\
+.section .text.startup \n\
.globl __start \n\
.type __start, @function \n\
__start: \n\
@@ -50,6 +50,7 @@
env[0...N] environment variables (pointers)
NULL. */
+ .section .text.startup
ENTRY (ENTRY_POINT)
/* Needed to make gdb backtraces stop here. */
@@ -122,7 +122,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START asm ("\
-.text\n\
+.section .text.startup\n\
.globl _start\n\
.type _start, %function\n\
.globl _dl_start_user\n\
@@ -69,7 +69,7 @@
.syntax unified
#endif
- .text
+ .section .text.startup
.globl _start
.type _start,#function
_start:
@@ -41,7 +41,7 @@
#include <sysdep.h>
- .text
+ .section .text.startup
.globl _start;
.type _start,@function;
.align 4;
@@ -98,7 +98,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
#define RTLD_START asm ("\
-.text\n\
+.section .text.startup\n\
.globl _start\n\
.type _start, @function\n\
.globl _dl_start_user\n\
@@ -135,6 +135,7 @@ _dl_start_user:\n\
lrw a0, _dl_fini@GOTOFF\n\
addu a0, gb\n\
jmp r10\n\
+.previous\n\
");
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
@@ -358,7 +358,7 @@ set_dp (struct link_map *map) \
} \
\
asm ( \
-" .text\n" \
+" .section .text.startup\n" \
" .globl _start\n" \
" .type _start,@function\n" \
"_start:\n" \
@@ -486,6 +486,7 @@ asm ( \
" ldw 4(%r3),%r19\n" /* load the object's gp */ \
" bv %r0(%r2)\n" \
" depi 2,31,2,%r23\n" /* delay slot */ \
+" .text\n" \
);
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
@@ -51,7 +51,7 @@
.Lp__libc_start_main:
.word P%__libc_start_main
- .text
+ .section .text.startup
.align 4
.globl _start
.export _start, ENTRY
@@ -124,7 +124,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START asm ("\n\
- .text\n\
+ .section .text.startup\n\
.align 16\n\
0: movl (%esp), %ebx\n\
ret\n\
@@ -156,7 +156,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START asm ( \
-".text\n" \
+".section .text.startup\n" \
" .global _start#\n" \
" .proc _start#\n" \
"_start:\n" \
@@ -47,6 +47,7 @@
* out6: stack_end
*/
+ .section .text.startup
.align 32
.global _start
@@ -83,7 +83,7 @@ static inline ElfW (Addr) elf_machine_dynamic (void)
its return value is the user program's entry point. */
#define RTLD_START asm (\
- ".text\n\
+ ".section .text.startup\n\
" _RTLD_PROLOGUE (ENTRY_POINT) "\
.cfi_label .Ldummy \n\
" CFI_UNDEFINED (1) " \n\
@@ -52,6 +52,7 @@ __libc_start_main (int (*main) (int, char **, char **),
void *stack_end);
*/
+ .section .text.startup
ENTRY (ENTRY_POINT)
/* Terminate call stack by noting ra is undefined. Use a dummy
@@ -127,7 +127,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START asm ("\
- .text\n\
+ .section .text.startup\n\
.globl _start\n\
.type _start,@function\n\
_start:\n\
@@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
- .text
+ .section .text.startup
.globl _start
_start:
call _hurd_stack_setup
@@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
- .text
+ .section .text.startup
.globl _start
_start:
@@ -92,7 +92,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START asm ("\
- .text\n\
+ .section .text.startup\n\
.globl _start\n\
.type _start,@function\n\
_start:\n\
@@ -33,7 +33,7 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
- .text
+ .section .text.startup
.globl _start
.type _start,@function
_start:
@@ -245,7 +245,7 @@ do { \
# define LOAD_31 "addiupc $31, 0"
# endif
# define RTLD_START asm (\
- ".text\n\
+ ".section .text.startup\n\
" _RTLD_PROLOGUE(ENTRY_POINT) "\
" STRINGXV(SETUP_GPX($25)) "\n\
" STRINGXV(SETUP_GPX64($18,$25)) "\n\
@@ -310,7 +310,7 @@ do { \
are to be supported. */
# define RTLD_START asm (\
- ".text\n\
+ ".section .text.startup\n\
.set mips16\n\
" _RTLD_PROLOGUE (ENTRY_POINT) "\
# Construct GP value in $3.\n\
@@ -71,7 +71,7 @@
void (*rtld_fini) (void), void *stack_end)
*/
- .text
+ .section .text.startup
.globl ENTRY_POINT
.type ENTRY_POINT,@function
#ifndef __mips16
@@ -97,7 +97,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START asm ("\
-.text\n\
+.section .text.startup\n\
.globl _start\n\
.type _start, %function\n\
_start:\n\
@@ -155,6 +155,7 @@ _start:\n\
\n\
/* Jump to the user's entry point. */\n\
jmp r16\n\
+.previous\n\
");
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
@@ -65,7 +65,7 @@
value, terminated by an AT_NULL tag.
*/
- .text
+ .section .text.startup
.globl _start
.type _start,%function
_start:
@@ -21,6 +21,7 @@
/* Initial entry point code for the dynamic linker.
The function _dl_start is the real entry point;
it's return value is the user program's entry point. */
+ .section .text.startup
ENTRY (_start)
/* Count arguments in r11 */
l.ori r3, r1, 0
@@ -50,6 +50,7 @@
#include <sysdep.h>
#include <entry.h>
+ .section .text.startup
ENTRY (ENTRY_POINT)
/* Setup Arguments to the __libc_start_main function. */
@@ -21,6 +21,7 @@
/* Initial entry point code for the dynamic linker.
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
+ .section ".text.startup"
ENTRY(_start)
/* We start with the following on the stack, from top:
argc (4 bytes);
@@ -56,7 +56,7 @@ L(start_addresses):
.long 0 /* Used to be fini. */
ASM_SIZE_DIRECTIVE(L(start_addresses))
- .section ".text"
+ .section ".text.startup"
ENTRY(_start)
/* Save the stack pointer, in case we're statically linked under Linux. */
mr r9,r1
@@ -125,7 +125,7 @@ elf_machine_dynamic (void)
`_dl_start' is the real entry point; its return value is the user
program's entry point. */
#define RTLD_START \
- asm (".pushsection \".text\"\n" \
+ asm (".pushsection \".text.startup\"\n" \
" .align 2\n" \
" " ENTRY_2(_start) "\n" \
BODY_PREFIX "_start:\n" \
@@ -61,7 +61,7 @@ L(start_addresses):
.section ".toc","aw"
.L01:
.tc L(start_addresses)[TC],L(start_addresses)
- .section ".text"
+ .section ".text.startup"
ENTRY (_start)
/* Save the stack pointer, in case we're statically linked under Linux. */
mr r9,r1
@@ -100,7 +100,7 @@ elf_machine_dynamic (void)
its return value is the user program's entry point. */
#define RTLD_START asm (\
- ".text\n\
+ ".section .text.startup\n\
" _RTLD_PROLOGUE (ENTRY_POINT) "\
mv a0, sp\n\
jal _dl_start\n\
@@ -42,6 +42,7 @@
a0 contains the address of a function to be passed to atexit.
__libc_start_main wants this in a5. */
+ .section .text.startup
ENTRY (ENTRY_POINT)
/* Terminate call stack by noting ra is undefined. Use a dummy
.cfi_label to force starting the FDE. */
@@ -168,7 +168,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START __asm__ ("\n\
-.text\n\
+.section text.startup\n\
.align 4\n\
.globl _start\n\
.globl _dl_start_user\n\
@@ -215,6 +215,7 @@ _dl_start_user:\n\
.Ladr0: .long _GLOBAL_OFFSET_TABLE_-.Llit\n\
.Ladr1: .long _dl_start-.Llit\n\
.Ladr4: .long _dl_init@PLT-.Llit\n\
+.previous\n\
");
#ifndef RTLD_START_SPECIAL_INIT
@@ -54,7 +54,7 @@
NULL
*/
- .text
+ .section .text.startup
.globl _start
.type _start,@function
_start:
@@ -151,7 +151,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START __asm__ ("\n\
-.text\n\
+.section .text.startup\n\
.align 4\n\
.globl _start\n\
.globl _dl_start_user\n\
@@ -191,6 +191,7 @@ _dl_start_user:\n\
aghi %r15,160\n\
# Jump to the user's entry point (saved in %r8).\n\
br %r8\n\
+.previous\n\
");
#ifndef RTLD_START_SPECIAL_INIT
@@ -54,7 +54,7 @@
NULL
*/
- .text
+ .section .text.startup
.globl _start
.type _start,@function
_start:
@@ -129,7 +129,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
its return value is the user program's entry point. */
#define RTLD_START asm ("\
-.text\n\
+.section .text.startup\n\
.globl _start\n\
.globl _dl_start_user\n\
_start:\n\
@@ -57,7 +57,7 @@
NULL
*/
- .text
+ .section .text.startup
.globl _start
.type _start,@function
_start:
@@ -176,7 +176,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
"ld [" #pic_reg " + " #reg "], " #reg ", %gdop(" #symbol ")"
#define RTLD_START __asm__ ("\
- .text\n\
+ .section .text.startup\n\
.globl _start\n\
.type _start, @function\n\
.align 32\n\
@@ -36,7 +36,7 @@
#include <sysdep.h>
- .section ".text"
+ .section ".text.startup"
.align 4
.global _start
.type _start,#function
@@ -222,7 +222,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
#define __S(x) __S1(x)
#define RTLD_START __asm__ ( "\n" \
-" .text\n" \
+" .section .text.startup\n" \
" .global _start\n" \
" .type _start, @function\n" \
" .align 32\n" \
@@ -36,7 +36,7 @@
#include <sysdep.h>
- .section ".text"
+ .section ".text.startup"
.align 4
.global _start
.type _start,#function
@@ -134,8 +134,8 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
#define RTLD_START asm ("\n\
-.text\n\
- .align 16\n\
+.section .text.startup\n\
+.align 16\n\
.globl _start\n\
.globl _dl_start_user\n\
_start:\n\
@@ -54,6 +54,7 @@
#include <sysdep.h>
+ .section .text.startup
ENTRY (_start)
/* Clearing frame pointer is insufficient, use CFI. */
cfi_undefined (rip)
@@ -35,7 +35,7 @@
The C function `_dl_start' is the real entry point;
its return value is the user program's entry point. */
#define RTLD_START asm ("\n\
-.text\n\
+.section .text.startup\n\
.p2align 4\n\
.globl _start\n\
.globl _dl_start_user\n\
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> --- sysdeps/aarch64/dl-start.S | 1 + sysdeps/aarch64/start.S | 2 +- sysdeps/alpha/dl-machine.h | 2 +- sysdeps/alpha/start.S | 2 +- sysdeps/arc/dl-machine.h | 2 +- sysdeps/arc/start.S | 1 + sysdeps/arm/dl-machine.h | 2 +- sysdeps/arm/start.S | 2 +- sysdeps/csky/abiv2/start.S | 2 +- sysdeps/csky/dl-machine.h | 3 ++- sysdeps/hppa/dl-machine.h | 3 ++- sysdeps/hppa/start.S | 2 +- sysdeps/i386/dl-machine.h | 2 +- sysdeps/ia64/dl-machine.h | 2 +- sysdeps/ia64/start.S | 1 + sysdeps/loongarch/dl-machine.h | 2 +- sysdeps/loongarch/start.S | 1 + sysdeps/m68k/dl-machine.h | 2 +- sysdeps/mach/hurd/i386/static-start.S | 2 +- sysdeps/mach/hurd/x86_64/static-start.S | 2 +- sysdeps/microblaze/dl-machine.h | 2 +- sysdeps/microblaze/start.S | 2 +- sysdeps/mips/dl-machine.h | 4 ++-- sysdeps/mips/start.S | 2 +- sysdeps/nios2/dl-machine.h | 3 ++- sysdeps/nios2/start.S | 2 +- sysdeps/or1k/dl-start.S | 1 + sysdeps/or1k/start.S | 1 + sysdeps/powerpc/powerpc32/dl-start.S | 1 + sysdeps/powerpc/powerpc32/start.S | 2 +- sysdeps/powerpc/powerpc64/dl-machine.h | 2 +- sysdeps/powerpc/powerpc64/start.S | 2 +- sysdeps/riscv/dl-machine.h | 2 +- sysdeps/riscv/start.S | 1 + sysdeps/s390/s390-32/dl-machine.h | 3 ++- sysdeps/s390/s390-32/start.S | 2 +- sysdeps/s390/s390-64/dl-machine.h | 3 ++- sysdeps/s390/s390-64/start.S | 2 +- sysdeps/sh/dl-machine.h | 2 +- sysdeps/sh/start.S | 2 +- sysdeps/sparc/sparc32/dl-machine.h | 2 +- sysdeps/sparc/sparc32/start.S | 2 +- sysdeps/sparc/sparc64/dl-machine.h | 2 +- sysdeps/sparc/sparc64/start.S | 2 +- sysdeps/x86_64/dl-machine.h | 4 ++-- sysdeps/x86_64/start.S | 1 + sysdeps/x86_64/x32/dl-machine.h | 2 +- 47 files changed, 54 insertions(+), 40 deletions(-)