From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id DB5513858C2C for ; Mon, 3 Jan 2022 13:41:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DB5513858C2C Received: by mail-pf1-x433.google.com with SMTP id q3so25133558pfs.7 for ; Mon, 03 Jan 2022 05:41:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C442kzUd++jy8pKWGRYFZmJYDf4Za5BiBayi5GFNQyI=; b=zN6942Pwb8of10sA3BNKtSxBvcUHtkkm8ioX7c6sPg/EMaSMqarkzv9EsXO8p7Eu9u XPLqmXF+wbq6Q9TR0RkTTmLQf74IsO/VsmBdfGm87QXvSVGGAsB9L1wnxjHOJZtz1w96 L1JJNd3cePwXVkX1ff5JCg94Zws2Kg6q5A6kVolRemyub2ZoqUL0BKK7ioa4y6e9Tz9e ws9xcmbd4Lw07pqoYtMDWTwEcwgfugAaFYN/0rUYJid1RJ6XbAUk+Gh4WY97yxkY20Bv r0wM09DwcMixlavw3puwF80s1MFQOSUNhsJoBiyoRtZSJpSrcBMbn26uzMcWWTcWmEdw FPpA== X-Gm-Message-State: AOAM5321jVRnWxCxXiqbGEKmFTn4mb/0an/vnMvGA5Pwj/zYI/LJwqhN 1d2uRhZ+Xw9gnsx2LSPcaXmpFUF+M+09LaJGql4= X-Google-Smtp-Source: ABdhPJyYYtcaeafABj3raWaWdPHrJSA65Vi8EpJWM/rMbUQZvvSwv+7VWYyFYrm7TCxBZH6fb5At+5eF29AISBMKTbI= X-Received: by 2002:a05:6a00:234e:b0:4ae:2e0d:cc68 with SMTP id j14-20020a056a00234e00b004ae2e0dcc68mr46535511pfj.60.1641217265009; Mon, 03 Jan 2022 05:41:05 -0800 (PST) MIME-Version: 1.0 References: <875yr1j90u.fsf@oldenburg.str.redhat.com> <871r1pj871.fsf@oldenburg.str.redhat.com> <87v8z1hsgj.fsf@oldenburg.str.redhat.com> <87mtkdhs11.fsf@oldenburg.str.redhat.com> In-Reply-To: <87mtkdhs11.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Mon, 3 Jan 2022 05:40:29 -0800 Message-ID: Subject: Re: ELF LOAD segments creating holes in the process image on GNU/Linux To: Florian Weimer Cc: Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3022.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2022 13:41:09 -0000 On Mon, Jan 3, 2022 at 5:23 AM Florian Weimer wrote: > > * H. J. Lu: > > >> Ideally? p_offset, p_vaddr, p_filesz, p_memsz should all be multiples > >> of the page size, to closer reflect what can actually be loaded. > >> > >> Then, for each LOAD segment, p_vaddr plus p_memsz should be equal to > >> p_vaddr of the next LOAD segment. > > > > Filled with zeros? > > No, with file contents. We can't zero-fill at a sub-page granularity. > There shouldn't be page-sized holes, definitely not for 4K-only targets. Do you mean padding these segments with zeros in file? -- H.J.