From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id EED6A385C406 for ; Mon, 21 Jun 2021 12:55:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EED6A385C406 Received: by mail-pg1-x530.google.com with SMTP id y14so2664432pgs.12 for ; Mon, 21 Jun 2021 05:55:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PRdKa2YZb90q0X0joecmjpnlZ5ZaN/8eWlJDPBvXLh0=; b=dRkHqqYGaYERR07DcgDN4ca5o72gevc+4SaLEBXLGccPjf4FDhdGSuBrvkc7IgJdHC gusRrXwIYzuMJMhTofJ1aJesYft8csJefEqMmTZhBDhmaLvhnK3jSkDd4ye7pLC3GdAB CkzVnEkeiRat3o87ZawQGmsTkhHolBvGeq7rN2jbpJcCeeGCe/+XYqvfYMuGkCxMSEHa 6MSFyZme2isAiW1bQDPZsShI9PwMiDFSJ7B728ZX7Tsyq2+MpKoo/qJYOPSHoLFloh5N YqtBpAywh63eOSO5+ozIthUehBEg0hO8buOzTv/0ujchM1R3iLg7x2CSsJYia0z8wY0Z UwdQ== X-Gm-Message-State: AOAM531vJkLT3RHmqsbxqDkO1C1BFiPjXAvHkwpLH9OSF8w5P2VBvIhl 1qa9uVP8SEyFUP+7zoFFpyEHRl10Gkctq0SeXNk= X-Google-Smtp-Source: ABdhPJzUwj4XCKYjOPDFPGMFy3t3Msr0h4yheuWB0HpjYJ1HH8tqdlnLnEhFHvGPRrW1r1uLYRI+G344SISSH1IF2qE= X-Received: by 2002:a65:478d:: with SMTP id e13mr15296445pgs.37.1624280134152; Mon, 21 Jun 2021 05:55:34 -0700 (PDT) MIME-Version: 1.0 References: <20210620233620.391576-1-hjl.tools@gmail.com> <20210620233620.391576-5-hjl.tools@gmail.com> <878s33n0q0.fsf@oldenburg.str.redhat.com> In-Reply-To: <878s33n0q0.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Mon, 21 Jun 2021 05:54:58 -0700 Message-ID: Subject: Re: [PATCH 4/4] Update tests for protected data and function symbols To: Florian Weimer Cc: "H.J. Lu via Libc-alpha" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3025.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 12:55:36 -0000 On Mon, Jun 21, 2021 at 12:19 AM Florian Weimer wrote: > > * H. J. Lu via Libc-alpha: > > > Protected data and function symbols don't work well without > > -fsingle-global-definition: > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37611 > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44166 > > > > 1. Compile tst-protected1[ab].c and tst-protected1mod[ab].c with > > -fsingle-global-definition if possible so that GOT entries are used > > for undefined data accesses. > > 2. Add tests for protected function pointers. > > 3. Build tst-prelink.c without single global definition to keepp COPY > > relocation. > > I think these tests need to check that the statically linked bits from > GCC have been built with -fsingle-global-definition. I don't think > that's guaranteed even if GCC supports -fsingle-global-definition. > > I think this shows the limitation of the single bit of markup: the > statically linked GCC bits are all hidden, so setting > GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION so is not correct as a > marker to *require* a single global definition, but neither is not > setting it because libgcc.a etc. should be *compatible* with > GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION. The output bit is ORed from all inputs. When one input object file doesn't work with COPY relocation, the final output object is marked incompatible with COPY relocation even if some inputs do work with COPY relocation. -- H.J.