From patchwork Mon May 15 14:48:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 69379 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B17C93850217 for ; Mon, 15 May 2023 14:49:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B17C93850217 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684162187; bh=B7TDpstBjoaF3+Smm5Mr+uqkVqs8HN456U8tOUYK88g=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=nY42OHLuKY7nlJnsb7371YokTvy9HA87VVIIJmvjcoXMAJrMI4beeazHsW/vZPKEe hbEBWfmgNNYLyV47Tmj+fNSA4g12Y3PwpuZW5uOcvM+S3tV1Mo5EOsfnMag86HzAkb wk7K35KQPMmocupl3eelaIznWYxKJyTmHiM3NW1Y= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 04ADC385700B for ; Mon, 15 May 2023 14:48:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04ADC385700B Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ac8c0fbb16so125138791fa.2 for ; Mon, 15 May 2023 07:48:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684162102; x=1686754102; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B7TDpstBjoaF3+Smm5Mr+uqkVqs8HN456U8tOUYK88g=; b=MPZ/rzm0ET7oVE78ZfOpj8P1pjIsyls38bvPYIoLR1G7QKPRW4sMiXjVTpKTK6NUhq ls3tW/YwpwJGjKhrDrVoN05pL55NWj58XGAnIfC0NQckjvKLhF3vhURiEWCHyx6zhTzB o1PUkTdh63+u8Rxu3nJiNHOAEkh2WIERQVq4PBIOW9SbPDR5Z4rxjWG8uJX0V045b5xQ KQMEBC4KuxgFQKRYxSIbNu8n1K8WW6hN6Uu5syyKSn6I/TtgjdYyVTxDPIi+IFgXMyJp qXnoT9h3e1ierue4CCY8zo/3b0dgWSSskfuRh2XtZ3oZtOpSP2STZTXtOLpEfovOxFyc At8Q== X-Gm-Message-State: AC+VfDzmJa9hlZ7DoIaNgL9gmNIXcUGmx2KprMSx9TBGRXp1cZstkdsS tbrA7X1d6mFsFGxCzpZsxm1BUIDtLm4= X-Google-Smtp-Source: ACHHUZ7ndegTzd1R/jE1RMF4AFlDJb2dnlYbFubCYOAT8L+X1abv9UF+9doQ00TPvA4tEmCuG0+nfg== X-Received: by 2002:ac2:5ec5:0:b0:4ec:89d3:a8a2 with SMTP id d5-20020ac25ec5000000b004ec89d3a8a2mr7513159lfq.43.1684162101798; Mon, 15 May 2023 07:48:21 -0700 (PDT) Received: from surface-pro-6.. ([194.190.106.50]) by smtp.gmail.com with ESMTPSA id w9-20020a056512098900b004f11e965308sm2643336lft.20.2023.05.15.07.48.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 07:48:21 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [RFC PATCH 5/6] Also place entry points into .text.startup Date: Mon, 15 May 2023 17:48:14 +0300 Message-Id: <20230515144815.3939017-6-bugaevc@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515144815.3939017-1-bugaevc@gmail.com> References: <20230515144815.3939017-1-bugaevc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sergey Bugaev via Libc-alpha From: Sergey Bugaev Reply-To: Sergey Bugaev Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Signed-off-by: Sergey Bugaev --- 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(-) diff --git a/sysdeps/aarch64/dl-start.S b/sysdeps/aarch64/dl-start.S index dd9c0725..1b7e7ca2 100644 --- a/sysdeps/aarch64/dl-start.S +++ b/sysdeps/aarch64/dl-start.S @@ -19,6 +19,7 @@ #include + .section .text.startup ENTRY (_start) /* Create an initial frame with 0 LR and FP */ cfi_undefined (x30) diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S index 9ec8e388..0f6f72ee 100644 --- a/sysdeps/aarch64/start.S +++ b/sysdeps/aarch64/start.S @@ -59,7 +59,7 @@ NULL */ - .text + .section .text.startup ENTRY(_start) /* Create an initial frame with 0 LR and FP */ cfi_undefined (x30) diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h index 5e748d2c..e003796c 100644 --- a/sysdeps/alpha/dl-machine.h +++ b/sysdeps/alpha/dl-machine.h @@ -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\ diff --git a/sysdeps/alpha/start.S b/sysdeps/alpha/start.S index 80d0ac36..8fef02db 100644 --- a/sysdeps/alpha/start.S +++ b/sysdeps/alpha/start.S @@ -35,7 +35,7 @@ #include - .text + .section .text.startup .align 3 .globl _start .ent _start, 0 diff --git a/sysdeps/arc/dl-machine.h b/sysdeps/arc/dl-machine.h index 4dc652a4..c640f81f 100644 --- a/sysdeps/arc/dl-machine.h +++ b/sysdeps/arc/dl-machine.h @@ -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\ diff --git a/sysdeps/arc/start.S b/sysdeps/arc/start.S index db3bab63..1af949be 100644 --- a/sysdeps/arc/start.S +++ b/sysdeps/arc/start.S @@ -50,6 +50,7 @@ env[0...N] environment variables (pointers) NULL. */ + .section .text.startup ENTRY (ENTRY_POINT) /* Needed to make gdb backtraces stop here. */ diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index 3825ec56..9484c033 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -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\ diff --git a/sysdeps/arm/start.S b/sysdeps/arm/start.S index f53f4581..c607712e 100644 --- a/sysdeps/arm/start.S +++ b/sysdeps/arm/start.S @@ -69,7 +69,7 @@ .syntax unified #endif - .text + .section .text.startup .globl _start .type _start,#function _start: diff --git a/sysdeps/csky/abiv2/start.S b/sysdeps/csky/abiv2/start.S index 1edbd0bb..b39cd09b 100644 --- a/sysdeps/csky/abiv2/start.S +++ b/sysdeps/csky/abiv2/start.S @@ -41,7 +41,7 @@ #include - .text + .section .text.startup .globl _start; .type _start,@function; .align 4; diff --git a/sysdeps/csky/dl-machine.h b/sysdeps/csky/dl-machine.h index 6bbe5427..10b8ff89 100644 --- a/sysdeps/csky/dl-machine.h +++ b/sysdeps/csky/dl-machine.h @@ -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 diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h index 7af13bba..144f7b01 100644 --- a/sysdeps/hppa/dl-machine.h +++ b/sysdeps/hppa/dl-machine.h @@ -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 diff --git a/sysdeps/hppa/start.S b/sysdeps/hppa/start.S index cfc22ab7..0d69f9c2 100644 --- a/sysdeps/hppa/start.S +++ b/sysdeps/hppa/start.S @@ -51,7 +51,7 @@ .Lp__libc_start_main: .word P%__libc_start_main - .text + .section .text.startup .align 4 .globl _start .export _start, ENTRY diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index d64494e7..c78c44f2 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -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\ diff --git a/sysdeps/ia64/dl-machine.h b/sysdeps/ia64/dl-machine.h index e1da3dad..941a7e74 100644 --- a/sysdeps/ia64/dl-machine.h +++ b/sysdeps/ia64/dl-machine.h @@ -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" \ diff --git a/sysdeps/ia64/start.S b/sysdeps/ia64/start.S index e07304d3..50d0c1bd 100644 --- a/sysdeps/ia64/start.S +++ b/sysdeps/ia64/start.S @@ -47,6 +47,7 @@ * out6: stack_end */ + .section .text.startup .align 32 .global _start diff --git a/sysdeps/loongarch/dl-machine.h b/sysdeps/loongarch/dl-machine.h index 1e07d124..41423bf9 100644 --- a/sysdeps/loongarch/dl-machine.h +++ b/sysdeps/loongarch/dl-machine.h @@ -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\ diff --git a/sysdeps/loongarch/start.S b/sysdeps/loongarch/start.S index e9d82033..5b2baaaf 100644 --- a/sysdeps/loongarch/start.S +++ b/sysdeps/loongarch/start.S @@ -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 diff --git a/sysdeps/m68k/dl-machine.h b/sysdeps/m68k/dl-machine.h index 5ee586b2..2376895e 100644 --- a/sysdeps/m68k/dl-machine.h +++ b/sysdeps/m68k/dl-machine.h @@ -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\ diff --git a/sysdeps/mach/hurd/i386/static-start.S b/sysdeps/mach/hurd/i386/static-start.S index c5d12645..3b8f9418 100644 --- a/sysdeps/mach/hurd/i386/static-start.S +++ b/sysdeps/mach/hurd/i386/static-start.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - .text + .section .text.startup .globl _start _start: call _hurd_stack_setup diff --git a/sysdeps/mach/hurd/x86_64/static-start.S b/sysdeps/mach/hurd/x86_64/static-start.S index cc8e2410..1b461a83 100644 --- a/sysdeps/mach/hurd/x86_64/static-start.S +++ b/sysdeps/mach/hurd/x86_64/static-start.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ - .text + .section .text.startup .globl _start _start: diff --git a/sysdeps/microblaze/dl-machine.h b/sysdeps/microblaze/dl-machine.h index da875b68..d6dec0c0 100644 --- a/sysdeps/microblaze/dl-machine.h +++ b/sysdeps/microblaze/dl-machine.h @@ -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\ diff --git a/sysdeps/microblaze/start.S b/sysdeps/microblaze/start.S index c35c4737..5f77e911 100644 --- a/sysdeps/microblaze/start.S +++ b/sysdeps/microblaze/start.S @@ -33,7 +33,7 @@ License along with the GNU C Library. If not, see . */ - .text + .section .text.startup .globl _start .type _start,@function _start: diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index a08e526a..73cccc1d 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -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\ diff --git a/sysdeps/mips/start.S b/sysdeps/mips/start.S index c08991c2..01ed88fa 100644 --- a/sysdeps/mips/start.S +++ b/sysdeps/mips/start.S @@ -71,7 +71,7 @@ void (*rtld_fini) (void), void *stack_end) */ - .text + .section .text.startup .globl ENTRY_POINT .type ENTRY_POINT,@function #ifndef __mips16 diff --git a/sysdeps/nios2/dl-machine.h b/sysdeps/nios2/dl-machine.h index 50c83df1..cc92de67 100644 --- a/sysdeps/nios2/dl-machine.h +++ b/sysdeps/nios2/dl-machine.h @@ -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 diff --git a/sysdeps/nios2/start.S b/sysdeps/nios2/start.S index 9179c330..33b2a128 100644 --- a/sysdeps/nios2/start.S +++ b/sysdeps/nios2/start.S @@ -65,7 +65,7 @@ value, terminated by an AT_NULL tag. */ - .text + .section .text.startup .globl _start .type _start,%function _start: diff --git a/sysdeps/or1k/dl-start.S b/sysdeps/or1k/dl-start.S index 6024568c..77409b57 100644 --- a/sysdeps/or1k/dl-start.S +++ b/sysdeps/or1k/dl-start.S @@ -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 diff --git a/sysdeps/or1k/start.S b/sysdeps/or1k/start.S index 92d39323..0573e712 100644 --- a/sysdeps/or1k/start.S +++ b/sysdeps/or1k/start.S @@ -50,6 +50,7 @@ #include #include + .section .text.startup ENTRY (ENTRY_POINT) /* Setup Arguments to the __libc_start_main function. */ diff --git a/sysdeps/powerpc/powerpc32/dl-start.S b/sysdeps/powerpc/powerpc32/dl-start.S index d42e8ded..dd358fab 100644 --- a/sysdeps/powerpc/powerpc32/dl-start.S +++ b/sysdeps/powerpc/powerpc32/dl-start.S @@ -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); diff --git a/sysdeps/powerpc/powerpc32/start.S b/sysdeps/powerpc/powerpc32/start.S index 644f6f53..e944cfbe 100644 --- a/sysdeps/powerpc/powerpc32/start.S +++ b/sysdeps/powerpc/powerpc32/start.S @@ -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 diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h index a69ad0ed..36d53663 100644 --- a/sysdeps/powerpc/powerpc64/dl-machine.h +++ b/sysdeps/powerpc/powerpc64/dl-machine.h @@ -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" \ diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S index f86d400f..3dbbc8ac 100644 --- a/sysdeps/powerpc/powerpc64/start.S +++ b/sysdeps/powerpc/powerpc64/start.S @@ -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 diff --git a/sysdeps/riscv/dl-machine.h b/sysdeps/riscv/dl-machine.h index c0c9bd93..a5577e36 100644 --- a/sysdeps/riscv/dl-machine.h +++ b/sysdeps/riscv/dl-machine.h @@ -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\ diff --git a/sysdeps/riscv/start.S b/sysdeps/riscv/start.S index 6dfe6527..f90928e8 100644 --- a/sysdeps/riscv/start.S +++ b/sysdeps/riscv/start.S @@ -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. */ diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h index cf784ed8..288b2159 100644 --- a/sysdeps/s390/s390-32/dl-machine.h +++ b/sysdeps/s390/s390-32/dl-machine.h @@ -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 diff --git a/sysdeps/s390/s390-32/start.S b/sysdeps/s390/s390-32/start.S index eb84e7ff..fb3a4b3b 100644 --- a/sysdeps/s390/s390-32/start.S +++ b/sysdeps/s390/s390-32/start.S @@ -54,7 +54,7 @@ NULL */ - .text + .section .text.startup .globl _start .type _start,@function _start: diff --git a/sysdeps/s390/s390-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h index 6ab736c3..ea23c3bd 100644 --- a/sysdeps/s390/s390-64/dl-machine.h +++ b/sysdeps/s390/s390-64/dl-machine.h @@ -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 diff --git a/sysdeps/s390/s390-64/start.S b/sysdeps/s390/s390-64/start.S index 61720c34..52b6b25f 100644 --- a/sysdeps/s390/s390-64/start.S +++ b/sysdeps/s390/s390-64/start.S @@ -54,7 +54,7 @@ NULL */ - .text + .section .text.startup .globl _start .type _start,@function _start: diff --git a/sysdeps/sh/dl-machine.h b/sysdeps/sh/dl-machine.h index f9492678..452dcd08 100644 --- a/sysdeps/sh/dl-machine.h +++ b/sysdeps/sh/dl-machine.h @@ -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\ diff --git a/sysdeps/sh/start.S b/sysdeps/sh/start.S index 6578eb40..e9d3e269 100644 --- a/sysdeps/sh/start.S +++ b/sysdeps/sh/start.S @@ -57,7 +57,7 @@ NULL */ - .text + .section .text.startup .globl _start .type _start,@function _start: diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h index 9b57ae1a..7eb5a78d 100644 --- a/sysdeps/sparc/sparc32/dl-machine.h +++ b/sysdeps/sparc/sparc32/dl-machine.h @@ -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\ diff --git a/sysdeps/sparc/sparc32/start.S b/sysdeps/sparc/sparc32/start.S index a82cbf33..f3ac4c8a 100644 --- a/sysdeps/sparc/sparc32/start.S +++ b/sysdeps/sparc/sparc32/start.S @@ -36,7 +36,7 @@ #include - .section ".text" + .section ".text.startup" .align 4 .global _start .type _start,#function diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h index 2f04ac55..a08cc1f3 100644 --- a/sysdeps/sparc/sparc64/dl-machine.h +++ b/sysdeps/sparc/sparc64/dl-machine.h @@ -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" \ diff --git a/sysdeps/sparc/sparc64/start.S b/sysdeps/sparc/sparc64/start.S index 158c4aa0..a69d1e06 100644 --- a/sysdeps/sparc/sparc64/start.S +++ b/sysdeps/sparc/sparc64/start.S @@ -36,7 +36,7 @@ #include - .section ".text" + .section ".text.startup" .align 4 .global _start .type _start,#function diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h index 34eb865e..4f85cae1 100644 --- a/sysdeps/x86_64/dl-machine.h +++ b/sysdeps/x86_64/dl-machine.h @@ -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\ diff --git a/sysdeps/x86_64/start.S b/sysdeps/x86_64/start.S index 4cedc721..4a6676e5 100644 --- a/sysdeps/x86_64/start.S +++ b/sysdeps/x86_64/start.S @@ -54,6 +54,7 @@ #include + .section .text.startup ENTRY (_start) /* Clearing frame pointer is insufficient, use CFI. */ cfi_undefined (rip) diff --git a/sysdeps/x86_64/x32/dl-machine.h b/sysdeps/x86_64/x32/dl-machine.h index 648a11f9..6f3164b1 100644 --- a/sysdeps/x86_64/x32/dl-machine.h +++ b/sysdeps/x86_64/x32/dl-machine.h @@ -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\