From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by sourceware.org (Postfix) with ESMTPS id D08DE3858C60 for ; Tue, 22 Aug 2023 07:19:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D08DE3858C60 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-40a47e8e38dso152521cf.1 for ; Tue, 22 Aug 2023 00:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1692688786; x=1693293586; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tWPcWYh1iGJyAth6no9JVMt56E6V3LtyPBC00aYErsI=; b=t2AeUqEnxGrxMD8N6YeY1y1W3kDvtrnwJm7n1vHFpIzm0rindhrMfv5mxcZAqAByo0 1mnK5urOGTLax5vD5P3mDP5vwymiD8+oHMxUgEm4NurLpzB6D23UH4SM4SkY3DXUFzYM mjb89gmlanv9fSSz6dk+zWPuPwbNdk7JfjdFuI9pk47gsPQh1GsF2SLjtUzFW7RVDsh8 gOjS9SfJ++kqxInFwV+y5G/S9NykFnITLU8oQl7YDwMpWhNMgU7eQ6O5lNDW29nlsiZP SIugJ7fhQbWuPQbMIH1Vkye76vj9QnNKofG2cbEx9+yVZU1hWeOby5X/TiftHAVPdiyF qWxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692688786; x=1693293586; h=content-transfer-encoding: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=tWPcWYh1iGJyAth6no9JVMt56E6V3LtyPBC00aYErsI=; b=hK1AwOk1Y2VC09pYQb7IPgdAdsP4n4mWDKd2830ZhhTZ4HHgSTOCVSTd4KzsgNYyhS JKhpgpWB5z9jvPJq3TsMIVFExxYjWOFUtLGhWPYsuO2O7g4Wm5QO3ShWMFyFNJFfb2x4 SHZVNlwBpdOwtMotPe+iWW72CkD4EQzfQZf0rViSljD8BPil84ssLEOWtmdQCCId5mpv +ChmlpDPAS3GPrIapgrWVccSb/LfziyFds8IzTMMdNUAhv/pM9H8tDVfiYw37GAKKAW2 OjWabF0ciBYDNkGTAuDRvWdyy4+JfU3V7HKbz3hsN93zzZD1wSkLamWmdxp61c5fZJKP Uefw== X-Gm-Message-State: AOJu0YyXKXZHsl7g1n3I6uiBSMVmMlneJ2OfN3MssFRSeBmMTZAJ3zSA smsg34/fp8ceELiL85f72/Q1yg5dgBFiXsdJwXtRCJLLallGob4JmqU= X-Google-Smtp-Source: AGHT+IHxK95yh6mBoj752pAu9VuXvz636GIc7aHNhXVG177DYBz4xAGJ0pzjfM1STrMBM7/p0K0rLtLMdUTMpw2BEEM= X-Received: by 2002:ac8:7f47:0:b0:3f8:5b2:aef0 with SMTP id g7-20020ac87f47000000b003f805b2aef0mr198820qtk.24.1692688785882; Tue, 22 Aug 2023 00:19:45 -0700 (PDT) MIME-Version: 1.0 References: <20230801195104.2183011-1-maskray@google.com> In-Reply-To: <20230801195104.2183011-1-maskray@google.com> From: Fangrui Song Date: Tue, 22 Aug 2023 00:19:34 -0700 Message-ID: Subject: Re: [PATCH v4] i386: Allow -mlarge-data-threshold with -mcmodel=large To: gcc-patches@gcc.gnu.org, Florian Weimer , "H.J. Lu" , Jan Beulich , Jan Hubicka , Michael Matz , Uros Bizjak Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-19.0 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,KAM_MANYTO,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Tue, Aug 1, 2023 at 12:51=E2=80=AFPM Fangrui Song w= rote: > > When using -mcmodel=3Dmedium, large data objects larger than the > -mlarge-data-threshold threshold are placed into large data sections > (.lrodata, .ldata, .lbss and some variants). GNU ld and ld.lld 17 place > .l* sections into separate output sections. If small and medium code > model object files are mixed, the .l* sections won't exert relocation > overflow pressure on sections in object files built with -mcmodel=3Dsmall= . > > However, when using -mcmodel=3Dlarge, -mlarge-data-threshold doesn't > apply. This means that the .rodata/.data/.bss sections may exert > relocation overflow pressure on sections in -mcmodel=3Dsmall object files= . > > This patch allows -mcmodel=3Dlarge to generate .l* sections and drops an > unneeded documentation restriction that the value must be the same. > > Link: https://groups.google.com/g/x86-64-abi/c/jnQdJeabxiU > ("Large data sections for the large code model") > > Signed-off-by: Fangrui Song > > --- > Changes from v1 (https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616= 947.html): > * Clarify commit message. Add link to https://groups.google.com/g/x86-64-= abi/c/jnQdJeabxiU > > Changes from v2 > * Drop an uneeded limitation in the documentation. > > Changes from v3 > * Change scan-assembler directives to use \. to match literal . > --- > gcc/config/i386/i386.cc | 15 +++++++++------ > gcc/config/i386/i386.opt | 2 +- > gcc/doc/invoke.texi | 6 +++--- > gcc/testsuite/gcc.target/i386/large-data.c | 13 +++++++++++++ > 4 files changed, 26 insertions(+), 10 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/i386/large-data.c > > [...] Ping:)