From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by sourceware.org (Postfix) with ESMTPS id BF6BC3858D34 for ; Wed, 6 Mar 2024 20:51:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF6BC3858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BF6BC3858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1136 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709758315; cv=none; b=FtNk3iYLktvPi6B0tfJ5gLE54WP1CQdvTJbFV94XFvcw2LGwVgPTcW7CzZ1j7gFBY2r1t8IJZSTT3BxPp/ivOo9qTdbCWnij6AM+JdgWhN9IS5Kjeykyk3JddKZwbi39JUTeMPXpqphs+h78iGka72HN0+65K0OuriVcN6T6IA0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709758315; c=relaxed/simple; bh=4SJne3F3qGFn4kW4e2LX3E1myiILcYsusRrI/cPvAAc=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=HYgPWGB1a9NAX50YGCb4ektHCnu55aUL2unm/LeF6P7oJ8NTdwbQdomLRnPpmlM9IQoy2GTJD0w35cwmxRdU3KBbK/YOTnfUbeZytGuyJH9dgKD/I1/8n+zGiFP9UYvUI/vyZVcIrZ3z1SKxk2uFza35VzcM5tWPFIbEwtFp3Gg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-6084e809788so10544097b3.1 for ; Wed, 06 Mar 2024 12:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709758312; x=1710363112; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=L8jf686vkO7wDNNm+abD3r9Nw/tMJRpoV4puoEDnx8Q=; b=Szo0a8gdNzxoHPnc/6hHlPtqfVdwb9c1GHn1ssSyOYBkx8RL/mYjhEOQdsLs3khgx3 6LYsUYOsOH4NAPhSxMOY4zPGAnajDmIdfuFwmESEB7EN9ftKzSJVslpnheosrxv5DjHU 71BvnpPoqbEHEG7ez2UwkLED11PoEJ/W6Sru6RhnIUiJtEp6KYCBqn/DBtyuTMAlcZqV pR+1meHCAmoQT2ODv3x8KcvsoX+lNjPcyNxDYDvA87o08nowIPX3Z4tTlawNN6dnH/Ew BPZr/SRcG3S5ZTy5qU61qF15jq038XZn0RYsnXyFuCcaUTN8cHHW5jIbqVdQF32oSGFc XnNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709758312; x=1710363112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L8jf686vkO7wDNNm+abD3r9Nw/tMJRpoV4puoEDnx8Q=; b=sPQh1FAznpx6NPyYwru8OLMG92+SLoTZ4a7DGwJKKzZBM/uzfQxH5HtlF+SAxOW3Bd yIfgxwsZWvZ9UUfKWXQVv++iHLrwfERMipjKnUkDuS35vyCtt5Eswfk2bDc95YE3xsrN iUTFyLTPi0QryMSRxHeR9V6VmTdQOCP/Zn1ND7LGDidZu7NkH1V7hdPRDH3/1VUdTJna gjc/vcbYGmPfnD8PQESqFQ8fBC5TI7aCLLCedzIaJLZbVEhKeSaIhFBT48mYY+N0X75d pVj57NWhqlI8Ufg95y+OHwbKe//QbBFR4j1OzcMJpRNtJ0u9muDGqCjoqUTMhgHyZFnd 5f7w== X-Gm-Message-State: AOJu0YyzSU4eP96qxflEnO/LQjFiTDVEdyAYanubcxek3GSciuujIT5w 8kiqy8JjaPR3v25xGRVNiYZX38vsMIHppSDOPcjXSpmqMw7kohEaLj4cpLhT/KhTCzP7nrcFLZp uvfE9iSBebIVoHXOabFRH8iWva8lMrRlyxYU= X-Google-Smtp-Source: AGHT+IG4AJv+0arr+3e9QM8W7egajXcNxWSamUe5CCH3AIuGR3fkGttA4UxRAF14UjXLdetZV6XEqUQ9vbtmk0FmS+Y= X-Received: by 2002:a81:bb4a:0:b0:609:8460:e29c with SMTP id a10-20020a81bb4a000000b006098460e29cmr1056233ywl.6.1709758312077; Wed, 06 Mar 2024 12:51:52 -0800 (PST) MIME-Version: 1.0 References: <20240305170057.292800-1-hjl.tools@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Wed, 6 Mar 2024 12:51:15 -0800 Message-ID: Subject: Re: [PATCH 0/4] elf: Use mmap to map in section contents To: Alan Modra Cc: binutils@sourceware.org, goldstein.w.n@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3014.0 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,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 List-Id: On Wed, Mar 6, 2024 at 8:16=E2=80=AFAM H.J. Lu wrote: > > On Tue, Mar 5, 2024 at 4:51=E2=80=AFPM Alan Modra wrot= e: > > > > On Tue, Mar 05, 2024 at 09:00:53AM -0800, H.J. Lu wrote: > > > We can use mmap to map in ELF section contents, instead of copying th= em > > > into memory by hand. We don't need to cache symbol nor relocation ta= bles > > > if they are mapped in. Data to link the 3.5GB clang executable in LL= VM > > > 17 debug build on Linux/x86-64 with 32GB RAM is: > > > > I like the idea. Some comments on the patch: > > - You should probably replace occurrences of HAVE_MMAP with USE_MMAP, > > and change the config default for --with-mmap. > > Fixed. > > > - There doesn't seem to be any reason to have an asize parameter to > > _bfd_mmap_readonly_tracked if you are going to give an error on > > unterminated string tables. (BTW, I don't disagree with giving an > > error.) > > Fixed. > > > - Can you put contents_addr in bfd_elf_section_data rather than > > bfd_section so that the extra pointer doesn't affect non-ELF > > targets? > > Fixed. > > > - _bfd_link_keep_memory should probably be moved to elflink.c, renamed > > to _elf_link_keep_memory and declared in elf-bfd.h. > > > > I renamed it to _bfd_elf_link_keep_memory. > > Here is the v2 patch: > > https://patchwork.sourceware.org/project/binutils/list/?series=3D31657 > The v3 patch is at: https://patchwork.sourceware.org/project/binutils/list/?series=3D31666 --=20 H.J.