From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 4A74A3852204 for ; Thu, 17 Nov 2022 20:52:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A74A3852204 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=googlemail.com Received: by mail-wr1-x433.google.com with SMTP id w14so5855500wru.8 for ; Thu, 17 Nov 2022 12:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=r47gvCoib9un/HODsHN38s8bzAD8G9zV/5YQ3Jtk1mQ=; b=XohIRVXgGfNToZ+nJEg33UXz9o0i5P+/vCWLQdiZP/bFRSBr1mmQYFe4PKlcYe/GnO De//0QCMqXtcY+h+ZsePMOZv0cs798IhVRdplWLSpj71sXvF1JqNrDogo7o3sR5a4tQj TbdnMntdiYfYeft0YAORolepe0Yxe/Ty3jvwSyO6jV6SUh1W8LnCfqeKaJYw/Z8WP64r XcKMixDnv+1Z3JI8VBHuFs/FGryKUA7B/7hP9VyilfDqE6gpItV9USatF6GTVfDAEkdu iz1RerpaQMESNQ5Vo1z4WrZ3Ak/h35OP5GqnvalDTbDbJqkoDrd/BvZ1xUcUCxKqyQvr hEOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=r47gvCoib9un/HODsHN38s8bzAD8G9zV/5YQ3Jtk1mQ=; b=qyodZFfNnWsnThTCABVFGUpr3Ii6GcHY9s1g/z+GOg7Xxmw3ozNeF6IliCGyDeLESi C3+NoWSZp6jWLvUucdVEQH+JgfH7O/cs1mDNtY8cgaVxpBlAkB76roIhN4B/r4xbIzk5 qHF3cdwbdZEFMFyqQL3mis3bAcQb2PUzpJac6jg10y3XCABDR1lTV87A+QoNi5X+SZA9 oHeqL8MiCAeNXscEJpnK/DE8QYtNJN1SLgh4DUv9/gzwHQXsL2NwCvLN8h/ro9B9zW1Q k8ZXCWrav7nDvMy+28Jiylf4fORogWdoPiDx9y7LM+2qq28HmYbrndjBPvVn7EyBCKeN 8BFA== X-Gm-Message-State: ANoB5pk51h5zUyVbuAnOdaG11zscAxwZnrTZ5x0URyYryrbiO535Bh2A nZ850IczCeZAHM3qPzwoX3FltMb/EwkTVPO6Yic= X-Google-Smtp-Source: AA0mqf6Ss8isk3qG28gVcER8e6/Nc5N+aM8HGHoUtAb0YL31dfLtvnkvBTpDmGPrrolG9OpcrCGy+Xh792+y5K53HaE= X-Received: by 2002:a5d:6342:0:b0:236:b222:13fb with SMTP id b2-20020a5d6342000000b00236b22213fbmr2469816wrw.307.1668718365731; Thu, 17 Nov 2022 12:52:45 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ramana Radhakrishnan Date: Thu, 17 Nov 2022 20:52:34 +0000 Message-ID: Subject: Re: [PATCH] AArch64: Add support for -mdirect-extern-access To: Richard Sandiford , Wilco Dijkstra , GCC Patches , Kyrylo Tkachov , "maskray@google.com" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Nov 17, 2022 at 5:30 PM Richard Sandiford via Gcc-patches wrote: > > Wilco Dijkstra writes: > > Hi Richard, > > > >> Can you go into more detail about: > >> > >> Use :option:`-mdirect-extern-access` either in shared libraries or in > >> executables, but not in both. Protected symbols used both in a shared > >> library and executable may cause linker errors or fail to work correctly > >> > >> If this is LLVM's default for PIC (and by assumption shared libraries), > >> is it then invalid to use -mdirect-extern-access for any PIEs that > >> are linked against those shared libraries and use protected symbols > >> from those libraries? How would a user know that one of the shared > >> libraries they're linking against was built in this way? > > > > Yes, the usage model is that you'd either use it for static PIE or only on > > data that is not shared. If you get it wrong them you'll get the copy > > relocation error. > > Thanks. I think I'm still missing something though. If, for the > non-executable case, people should only use the feature on data that > is not shared, why do we need to relax the binds-local condition for > protected symbols on -fPIC? Oughtn't the symbol to be hidden rather > than protected if the data isn't shared? > > I can understand the reasoning for the PIE changes but I'm still > struggling with the PIC-but-not-PIE bits. I think I'm with Richard S on hidden vs protected on first reading. I can see why this works out of the box and can even be default for static-pie. Any reason why this is not on by default - it's early enough in the stage3 cycle and we can always flip the defaults if there are more problems found. You probably need a rebase for the documentation bits,. regards Ramana Ramana