From nobody Thu Apr 25 02:17:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass(p=reject dis=none) header.from=seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1657676175; cv=none; d=zohomail.com; s=zohoarc; b=HSL1VXoMTqVTfXz9nBxkRRDrb2y7jeOzCAyf6TA2uq7LiAsY9Kw+dC9jSVu8Bnb1Vs580jrTT6helyndjvf+c8lYS8ygZnaJrD09uMTPXV7QfD4xnNjO67GhSCtfmteqByIIu5RwH16gEoRA0kOqJoIakOwEH7fsO2UCP0MF2rM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657676175; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Subject:To; bh=Z1RO+oM82zRVw3eSab5hyB2KokzltGPy8DJdJNRgoy4=; b=OqEkqpvghc6jU+Lw6mQyXamrT12fk3q9cf+6Fo5uybViPyQCQX9GebrztZxm/D1DdTBTubyaVC006vNNqWlvR35jZaJmHd6rDvAVdkf5AKKGL3um0wDnGZaueLRmmH6Yt/wYiFEIVE0eaDZxacXH2YOIoZLewQn0oJstuPv1khA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1657676175577757.340584054401; Tue, 12 Jul 2022 18:36:15 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id A80AB2DE6F; Wed, 13 Jul 2022 01:36:10 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 607612D860 for ; Wed, 13 Jul 2022 01:35:21 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) for ; Tue, 12 Jul 2022 18:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seabios.org; s=dkim; t=1657676172; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-owner: list-unsubscribe:list-subscribe:list-post; bh=Z1RO+oM82zRVw3eSab5hyB2KokzltGPy8DJdJNRgoy4=; b=0UCKw3XARD9tsXYF8jYC8JlegFuppJmn/oCmlMhcuGK4Nmo1l++pBlecsGY6L0YD1lMZfG VKOXBioEDF4NgXdKaSbSmJsO6ZWmzy5X3PwEMBCe1oLPXclajH3LHbY1Vag2+2/75AQlp9 +rHVJG0r9mYmsVWDygfPVDfQPTDZ8u0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=8G+gdTloox5jqF0b0baw/43t3B3oVNSWdmHAvvxtLbI=; b=Jy+Lv829WZWPJtNqsOPpGcr8k0ivFRKTQCMaJmLmI0xgYr4IFDz7F+jzq0XNdP4BwI dBzbIItTSwJ1Td9TV9ZBc84U5Tbd39KsE41t1F7Ycndf6e8xyV06HtXAC0bhlM6cx/5f O5pkStekDnfjATJ6gJ08cXnGuXrRF5eFPMTKaYHITK1gQTHmumP/h4y3xrMHXiDQQtdj hnmJt9kb3B8E80/DkXQfsZ6f5ZGkIRGVb7xbSfRB3ox26uGqdWU5B5vQKoM65M40LCGO 1wolkXs6RV9oKzv1EOiiiXJSlY9R67fgfDGehQXsdt3eq46U7m/2ZPFYfRmo+N+XI3JA sWRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=8G+gdTloox5jqF0b0baw/43t3B3oVNSWdmHAvvxtLbI=; b=uwzz7NMbpaU98qfQe+C90eh2qqU+KTMjv/TCwHXHt5ugMCXVSgVNNFerNiyaPVCeUM p+XWq0zT6NoglxalZjzfVD6xv7ZFUrIp9NtjQUNdKjXFmWZIMYcmeJB2KIxCv62fw+Dp 0GtIM1iVeGFjpS4aeTzZiVlJ55v8j8/SGWXd4hmIK8LPMa3C2GvWkz50T8M8Ys3OTN83 O6bu25CvRDneSQYDNrJc79prMEPskcE2ypD9DmtRx6ws4RKlg6tUkGyv73CZvffNqA7W lGGh5wQHjIuOI4/B3LnmzqZw0FkBcVsHOM0eYg6W9rGITdxhsSKMEUXwxFoYdHgFGHmA dfFA== X-Gm-Message-State: AJIora/gQh5oIoeIIUrMygVntWPGqvGUwRbknTaDYlUYb6fF0Fo/15av o958TCgfz7Q1RT9oPitciZegRQ69i0l1w7AQyT7xYocHGp6qTY+3tEglPKGiSFE+cCKJNk8LD9j GhPv6RhiXRSE9Ki9b6Wjd9VSCTbDyGF90QVtDs4w1VFqCA16xPEZvsY4mr4kn X-Google-Smtp-Source: AGRyM1vZ8SlYndcc+73vesxIGTYL9U0Dj1vwAerWmt0CZOP7Hzr36SH9icfsJYsW2bMuLCyAHr6eQ+z651yW X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:2d73:f468:8288:85ec]) (user=maskray job=sendgmr) by 2002:a25:bdc6:0:b0:66e:3b23:55f6 with SMTP id g6-20020a25bdc6000000b0066e3b2355f6mr1323025ybk.230.1657676120207; Tue, 12 Jul 2022 18:35:20 -0700 (PDT) Date: Tue, 12 Jul 2022 18:35:07 -0700 In-Reply-To: <20220713013508.3428114-1-maskray@google.com> Message-Id: <20220713013508.3428114-4-maskray@google.com> Mime-Version: 1.0 References: <20220713013508.3428114-1-maskray@google.com> To: seabios@seabios.org, Brad Smith Message-ID-Hash: Y6JFLERA2ESQMISGB33BYG5JCBHPBAIB X-Message-ID-Hash: Y6JFLERA2ESQMISGB33BYG5JCBHPBAIB X-MailFrom: 3WCHOYgcKB-8dRjbiRpXffXcV.TfdjVRSZfjjVRSZfj.fiX@flex--maskray.bounces.google.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Fangrui Song X-Mailman-Version: 3.3.5rc1 Precedence: list Subject: [SeaBIOS] [PATCH v4 3/4] romlayout32flag.lds: Use `. +=` instead of `. =` List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Fangrui Song via SeaBIOS Reply-To: Fangrui Song Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: --- X-ZohoMail-DKIM: pass (identity @seabios.org) X-ZM-MESSAGEID: 1657676177640100001 Content-Type: text/plain; charset="utf-8" This improves the portability of the linker script and allows lld to link r= om.o Dot assignment inside an output section has an inconsistent behavior which makes lld difficult to implement. See https://bugs.llvm.org/show_bug.cgi?id=3D43083 Dropping `. =3D` turns out to be beneficial to older GNU ld as well because we can delete an ld check detecting "cannot move location counter backwards". Signed-off-by: Fangrui Song --- scripts/layoutrom.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py index fa270ef..7bc4a57 100755 --- a/scripts/layoutrom.py +++ b/scripts/layoutrom.py @@ -336,14 +336,19 @@ def outRelSections(sections, startsym, useseg=3D0): if section.finalloc is not None] sections.sort(key=3Doperator.itemgetter(0)) out =3D "" + location =3D "_reloc_init_end" for addr, section in sections: loc =3D section.finalloc if useseg: loc =3D section.finalsegloc - out +=3D ". =3D ( 0x%x - %s ) ;\n" % (loc, startsym) + if location =3D=3D "_reloc_init_end": + out +=3D ". +=3D 0x%x - %s ;\n" % (loc, location) + elif location < loc: + out +=3D ". +=3D 0x%x ;\n" % (loc-location,) if section.name in ('.rodata.str1.1', '.rodata'): out +=3D "_rodata%s =3D . ;\n" % (section.fileid,) out +=3D "*%s.*(%s)\n" % (section.fileid, section.name) + location =3D loc + section.size return out =20 # Build linker script output for a list of relocations. --=20 2.37.0.144.g8ac04bfd2-goog _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org