From owner-freebsd-hackers@freebsd.org Tue Jun 12 17:11:27 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBCA410089F8 for ; Tue, 12 Jun 2018 17:11:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BCCF6F5AF for ; Tue, 12 Jun 2018 17:11:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id l19-v6so249209ioj.5 for ; Tue, 12 Jun 2018 10:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=x5REzk5jnfYN8HQkfIFFSUZC7R4vxhJRzMFl1C8KRK0=; b=UxVW9R06xUDEB3m0fM+FaxwHlmG2yjbgVLpjAN5zON0WbTuNtmya4bzOHnKvTWYg2l hXMadv1QgN60kU6+DQ6mlemNxlSbpb5ggyMk/4eOK634poRPyJlzSGdoR4KgzNdkTIaw OxSZFI9R54j7vBFJK/Vfx0aIcFDd+JuTS99hcN2rs0pQ4cX92U460u7nS9knRj19lYOP 29+FLWqg0ucDw15bzQK3Zu6Eimj5DK2EqxnzbswuJVqTmZ6LunO8s0SNQ43DgIvJdEUa 4Umbc52RY9u7Gc4tL8MRvURmMD9dSR/q78LzohSqMQ1mW/Gb4+AShe64QbgXgwNWdASF Hj2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=x5REzk5jnfYN8HQkfIFFSUZC7R4vxhJRzMFl1C8KRK0=; b=bfUvfFwJJLNXxDxN4SixGz3lUKtWLqTesxU5hYIxzUMC8K+ilfxhzGXKUGUvqRVulV 0V5jixgCSRvr6QQBrX9lHb3x0tUL5kzVNpwGJufyvkTOwuuQjqNXkhJDF7l56gh9O7bU AErxjtrugAZclE6zBF/x7UqFFpeBC34Zdi1XeKYNZ67RwlVX6Ev2F9ALwxj1eT7YSe5x 7o/+CCqcwOPaTW5Hagjc8jC9+QK/dhWwIJVLxYzWyOVdX4PtqT+GOC9HdQYJHiidUWMq PanyPH4cIybnzmbOSLQHKQ1Xbc7eNhbKqkwkW58ASLEZp4sELQd083Rjx0bngc6DDP2z eTxw== X-Gm-Message-State: APt69E0Use/nrXu7FqzqQn3JGMeEXikRsa/XUCtjpvtxnVuA3qmCwq1Q eXTi5UgW8t4uCt+kCX6a5/mTbBUxyTTPGHgB9V6qXw== X-Google-Smtp-Source: ADUXVKLTd/LUIh3yAREbCJveTdlrfH0QUlvI+LX8Q7ljLMYMF0ffRawSZVz/8N5Ig4YRq0SVpp/U0UxEKQvAR2IvpFw= X-Received: by 2002:a6b:29c4:: with SMTP id p187-v6mr1294731iop.299.1528823485829; Tue, 12 Jun 2018 10:11:25 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:d028:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 10:11:25 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180612170420.GD56138@raichu> References: <20180612170420.GD56138@raichu> From: Warner Losh Date: Tue, 12 Jun 2018 11:11:25 -0600 X-Google-Sender-Auth: OGJsI99B5ydZcbrr26KtNYGdVns Message-ID: Subject: Re: specifying alignment of loader files To: Mark Johnston Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 17:11:27 -0000 On Tue, Jun 12, 2018 at 11:04 AM, Mark Johnston wrote: > Hi, > > I'm writing some code which processes a file loaded by the loader. I > want the file's contents to be available at a certain alignment in > memory, and as far as I can see, the loader provides no alignment > guarantees today. The access will happen early enough during boot that > making an aligned copy of the data will be awkward, so I'd like the > loader to provide the desired alignment. > > I'm considering adding a new "module_align" variable that would specify > the alignment for a given file type, and plumb that through to > command_load(). Does anyone have an alternate suggestion, or an > objection to my proposal? > I thought the loader already did that for ELF sections... Why not wrap your file in such a segment? Warner