From nobody Sun Feb 25 00:58:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tj53B4FGHz5BxW7; Sun, 25 Feb 2024 00:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tj53B1mVFz4tJC; Sun, 25 Feb 2024 00:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708822710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f8mRnsIhRCab7mnsVXJf6J7Sp3okwaCM9Q6E5WYzBAg=; b=G9jak/OcrWQqKA2BYbMDFwcTpR8VJaiLqoViHEj2p4K4+MbtULy+qe7P1OJWquguydTSZD Vh2PZm2WJywT/M+OGa56u6qxeJYKRLslxDw3GCmhQTxVP0DIRP89M4WfUgeZza8RVkd9NJ RhEcKwfynWYFxmfREtUzLh163duZf9/Ywclwrd6blp+T40toeG7N6lwG/Yapr0vzcOY1Jb mqlm8g6sjAJPjkrmEsonLu+f7imJdaCk+6nEm5lPuWXANIcRtbC7lDNugS7YvwmrZd6VYR xUxPwzseFai9dZAvKxFBNPO0ENtbHIB4qs6Uinf1bM7BPaeOqMjvfDfZ2j956g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708822710; a=rsa-sha256; cv=none; b=uyOV0FM1yx7PfNwIfIzk7dFpJAhoLg8DIdCUKYfO4ZYDxi6nRagEpo8Zet5I2C3F97kyCt xe9FJ7dAeu7sqPWzMe7XkVrD21Ltp56J1MK0pcS+1M1KueNafonQ3wginPfHGnvaNFZFIy KfeNg9yBuxLrbQe6/pUC+RmYATaIqGNOrVznkZbiB/dodwk/o6F3MGBOs7lmW2QOuzLJIo PZ04G24cD0MksoM1hHBvd9FMw1rFPlOvQdPt9lTCjg7kaMbvrDRSfHWm+mAZKW8c0+3fI/ +gI3KX6Zx6gu/0YA1yzmn4i0JVkUw/MjXGyuwak4tlKqfYYXxiAicg/zRkkHoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708822710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f8mRnsIhRCab7mnsVXJf6J7Sp3okwaCM9Q6E5WYzBAg=; b=YPvlYmi81DL2xLolbXixhumi8U/Lg7T66isXprKIw/Elmb0XR9VC75GqIAHHz0tAA1JR7t vv5GsPqiZgDiXHAXwjnXXIxYDoIOgP/GxIRuZttFejUx0LeR6LCQyjND5ZAN8yucGvCxtn kFu/GeIa/08FpwsJTGw9gUqOe0fXlvZoQMLtXZksVjZMjrZeBzFGW4B4bmBlY9QeiQHC7E 5bZ3qDwLvSdgMPXIsnnZP41RiVVVTNgBNx+5iveXt8i9txlrTpqbSkTtc2+Dkj75LT8Viy UuwU0JcPyEV9C5yE7+gaPEyzhsY/4ggkGeKMkmy9jOYnjI3a3aCJtKSDclWATg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tj53B0q1nzNJb; Sun, 25 Feb 2024 00:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P0wUlm081615; Sun, 25 Feb 2024 00:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P0wUAo081612; Sun, 25 Feb 2024 00:58:30 GMT (envelope-from git) Date: Sun, 25 Feb 2024 00:58:30 GMT Message-Id: <202402250058.41P0wUAo081612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: fe4ab1fdb0da - main - loader/powerpc: Share ldscript List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe4ab1fdb0da06ddfbd8bf168db9f91b66609253 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fe4ab1fdb0da06ddfbd8bf168db9f91b66609253 commit fe4ab1fdb0da06ddfbd8bf168db9f91b66609253 Author: Warner Losh AuthorDate: 2024-02-25 00:56:31 +0000 Commit: Warner Losh CommitDate: 2024-02-25 00:56:31 +0000 loader/powerpc: Share ldscript Share ldscript between the different ppc versions. There's two different scripts since we build 32-bit binaries for all types of powerpc, but have little endian and big endian variations that are different by only two lines. Set the output format and include the rest. Move to foo.ldscript as well. Sponsored by: Netflix Reviewed by: tsoome, kevans Differential Revision: https://reviews.freebsd.org/D44058 --- stand/powerpc/ofw/Makefile | 6 +- stand/powerpc/ofw/ldscript.powerpcle | 142 --------------------- stand/powerpc/ofw/powerpc.ldscript | 3 + stand/powerpc/ofw/powerpc64.ldscript | 3 + stand/powerpc/ofw/powerpc64le.ldscript | 3 + stand/powerpc/ofw/powerpcspe.ldscript | 3 + .../ofw/{ldscript.powerpc => ppc-common.ldscript} | 3 - 7 files changed, 13 insertions(+), 150 deletions(-) diff --git a/stand/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile index b7cbbd9fca00..80ebaf486296 100644 --- a/stand/powerpc/ofw/Makefile +++ b/stand/powerpc/ofw/Makefile @@ -47,11 +47,7 @@ CFLAGS+= -DRELOC=${RELOC} -g LDFLAGS= -nostdlib -static -.if ${MACHINE_ARCH} == "powerpc64le" -LDFLAGS+= -T ${.CURDIR}/ldscript.powerpcle -.else -LDFLAGS+= -T ${.CURDIR}/ldscript.powerpc -.endif +LDFLAGS+= -L ${.CURDIR} -T ${.CURDIR}/${MACHINE_ARCH}.ldscript # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/libofw/libofw.a diff --git a/stand/powerpc/ofw/ldscript.powerpcle b/stand/powerpc/ofw/ldscript.powerpcle deleted file mode 100644 index 946e3dd48ae9..000000000000 --- a/stand/powerpc/ofw/ldscript.powerpcle +++ /dev/null @@ -1,142 +0,0 @@ - -OUTPUT_FORMAT("elf32-powerpcle-freebsd", "elf32-powerpcle-freebsd", - "elf32-powerpcle-freebsd") -OUTPUT_ARCH(powerpcle:common) -ENTRY(_start) -SEARCH_DIR(/usr/lib); -PROVIDE (__stack = 0); -PHDRS -{ - text PT_LOAD; -} -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = 0x02c00000 + SIZEOF_HEADERS; - .interp : { *(.interp) } :text - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .gnu.version : { *(.gnu.version) } - .gnu.version_d : { *(.gnu.version_d) } - .gnu.version_r : { *(.gnu.version_r) } - .rela.text : - { *(.rela.text) *(.rela.gnu.linkonce.t*) } - .rela.data : - { *(.rela.data) *(.rela.gnu.linkonce.d*) } - .rela.rodata : - { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } - .rela.got : { *(.rela.got) } - .rela.got1 : { *(.rela.got1) } - .rela.got2 : { *(.rela.got2) } - .rela.ctors : { *(.rela.ctors) } - .rela.dtors : { *(.rela.dtors) } - .rela.init : { *(.rela.init) } - .rela.fini : { *(.rela.fini) } - .rela.bss : { *(.rela.bss) } - .rela.plt : { *(.rela.plt) } - .rela.sdata : { *(.rela.sdata) } - .rela.sbss : { *(.rela.sbss) } - .rela.sdata2 : { *(.rela.sdata2) } - .rela.sbss2 : { *(.rela.sbss2) } - .text : - { - *(.text) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - *(.gnu.linkonce.t*) - } =0 - _etext = .; - PROVIDE (etext = .); - .init : { *(.init) } =0 - .fini : { *(.fini) } =0 - .rodata : { *(.rodata) *(.gnu.linkonce.r*) } - .rodata1 : { *(.rodata1) } - .sdata2 : { *(.sdata2) } - .sbss2 : { *(.sbss2) } - /* Adjust the address for the data segment to the next page up. */ - . = ((. + 0x1000) & ~(0x1000 - 1)); - .data.rel.ro : { *(.data.rel.ro*) } - .data : - { - *(.data) - *(.gnu.linkonce.d*) - CONSTRUCTORS - } - .data1 : { *(.data1) } - .got1 : { *(.got1) } - .dynamic : { *(.dynamic) } - /* Put .ctors and .dtors next to the .got2 section, so that the pointers - get relocated with -mrelocatable. Also put in the .fixup pointers. - The current compiler no longer needs this, but keep it around for 2.7.2 */ - PROVIDE (_GOT2_START_ = .); - .got2 : { *(.got2) } - PROVIDE (__CTOR_LIST__ = .); - .ctors : { *(.ctors) } - PROVIDE (__CTOR_END__ = .); - PROVIDE (__DTOR_LIST__ = .); - .dtors : { *(.dtors) } - PROVIDE (__DTOR_END__ = .); - PROVIDE (_FIXUP_START_ = .); - .fixup : { *(.fixup) } - PROVIDE (_FIXUP_END_ = .); - PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - .got : { *(.got) } - .got.plt : { *(.got.plt) } - PROVIDE (_GOT_END_ = .); - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata : { *(.sdata) } - _edata = .; - PROVIDE (edata = .); - .sbss : - { - PROVIDE (__sbss_start = .); - *(.sbss) - *(.scommon) - *(.dynsbss) - PROVIDE (__sbss_end = .); - } - .plt : { *(.plt) } - .bss : - { - PROVIDE (__bss_start = .); - *(.dynbss) - *(.bss) - *(COMMON) - } - _end = . ; - PROVIDE (end = .); - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* These must appear regardless of . */ -} - diff --git a/stand/powerpc/ofw/powerpc.ldscript b/stand/powerpc/ofw/powerpc.ldscript new file mode 100644 index 000000000000..aa48f257af1a --- /dev/null +++ b/stand/powerpc/ofw/powerpc.ldscript @@ -0,0 +1,3 @@ +OUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd", + "elf32-powerpc-freebsd") +INCLUDE "ppc-common.ldscript" diff --git a/stand/powerpc/ofw/powerpc64.ldscript b/stand/powerpc/ofw/powerpc64.ldscript new file mode 100644 index 000000000000..aa48f257af1a --- /dev/null +++ b/stand/powerpc/ofw/powerpc64.ldscript @@ -0,0 +1,3 @@ +OUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd", + "elf32-powerpc-freebsd") +INCLUDE "ppc-common.ldscript" diff --git a/stand/powerpc/ofw/powerpc64le.ldscript b/stand/powerpc/ofw/powerpc64le.ldscript new file mode 100644 index 000000000000..269d8121db6b --- /dev/null +++ b/stand/powerpc/ofw/powerpc64le.ldscript @@ -0,0 +1,3 @@ +OUTPUT_FORMAT("elf32-powerpcle-freebsd", "elf32-powerpcle-freebsd", + "elf32-powerpcle-freebsd") +INCLUDE "ppc-common.ldscript" diff --git a/stand/powerpc/ofw/powerpcspe.ldscript b/stand/powerpc/ofw/powerpcspe.ldscript new file mode 100644 index 000000000000..aa48f257af1a --- /dev/null +++ b/stand/powerpc/ofw/powerpcspe.ldscript @@ -0,0 +1,3 @@ +OUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd", + "elf32-powerpc-freebsd") +INCLUDE "ppc-common.ldscript" diff --git a/stand/powerpc/ofw/ldscript.powerpc b/stand/powerpc/ofw/ppc-common.ldscript similarity index 97% rename from stand/powerpc/ofw/ldscript.powerpc rename to stand/powerpc/ofw/ppc-common.ldscript index 1c023ce6ade6..e12dee74824a 100644 --- a/stand/powerpc/ofw/ldscript.powerpc +++ b/stand/powerpc/ofw/ppc-common.ldscript @@ -1,6 +1,3 @@ - -OUTPUT_FORMAT("elf32-powerpc-freebsd", "elf32-powerpc-freebsd", - "elf32-powerpc-freebsd") OUTPUT_ARCH(powerpc:common) ENTRY(_start) SEARCH_DIR(/usr/lib);