From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id 0C6753858D39 for ; Wed, 2 Mar 2022 08:41:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0C6753858D39 Received: by mail-pg1-x534.google.com with SMTP id 12so1087872pgd.0 for ; Wed, 02 Mar 2022 00:41:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ina3tj317ve2qqOC++H8v8tpqMgV2zuuKVbkJUFtrt4=; b=GzlEJVyZmzG3hp/ivtFKeXbuDYFv8gWGkSxuuk7ov8OxOiZc5HPJmnqeTIwBrdoeej mQJPgcvoradP08jUEnhfF/jJJtyHAlHNirkZS+OCmqPUv8E5FLThK30DZ6rSBujkQd+s ivI6fi6M0V4B6l5azYGgAK+xrIHYR0ZwqnFTAg4+0Iv2PEBC8pXvkJ3aPDrIjmPFL0Xk /WUIDDuoBlv2PgJSQ3t9uvKxGDyJ+9jzV0pkcli1eOaTMvw4y2LAQiwgquDgfkvNzLrB Hz2/QjbW+OvvVMeqkSrWHhmr5pdIKf42hqyZJy+8apwjZpJxc872TkOg7hE3ZzjLuiBe D7PQ== X-Gm-Message-State: AOAM532G60gdfkbLKdd7uOAQwAmebvHBliZjju+rxmP7xI9dynNFnyYA 5OZh5C+3NvUF3W3Ciu4vjAmcKClndeE= X-Google-Smtp-Source: ABdhPJxtX1gG10QhV8t2BoCK15Fzd9LouhBhJzrVTCVE1azw8hQKWcER9F+pdfHfk/4OPnP8VGYktw== X-Received: by 2002:a63:534d:0:b0:374:da8c:ad53 with SMTP id t13-20020a63534d000000b00374da8cad53mr25095657pgl.100.1646210482991; Wed, 02 Mar 2022 00:41:22 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:8afe:7171:d0fa:db67]) by smtp.gmail.com with ESMTPSA id y12-20020a056a00190c00b004f39e28fb87sm21210159pfi.98.2022.03.02.00.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 00:41:21 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id E01161140BFE; Wed, 2 Mar 2022 19:11:18 +1030 (ACDT) Date: Wed, 2 Mar 2022 19:11:18 +1030 From: Alan Modra To: "H.J. Lu" Cc: Binutils Subject: Re: PowerPC64 DT_RELR Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="RnhtzxQ6j1IuTAOg" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3037.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Wed, 02 Mar 2022 08:41:25 -0000 --RnhtzxQ6j1IuTAOg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I had a look today at DT_RELR again, and found I need to do some work in the linker. Just keeping addresses of relative relocs isn't enough, because data addresses can change between ppc64_elf_size_stubs and ppc64_elf_build_stubs. Anyway, the reason for the email is to inform anyone playing with DT_RELR on powerpc64 that the current support is definitely experimental! Also, you might like to apply the attached patch to gitlab.com/x86-glibc/glibc users/hjl/relr/master branch. glibc regressions went from 574 to 17. -- Alan Modra Australia Development Lab, IBM --RnhtzxQ6j1IuTAOg Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0006-elf-ELF_DYNAMIC_RELOCATE-order-relr-before-rel-rela.patch" >From 59265b9b769a0423700bd5a34bc9933e859e51c2 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 2 Mar 2022 15:34:58 +1030 Subject: [PATCH 6/6] elf: ELF_DYNAMIC_RELOCATE: order relr before rel/rela ld goes to some trouble to sort relative relocs first, so that ifunc resolvers that require relocated got entries have them relocated. Preserve that ordering. diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h index 320a9029f2..252f407a12 100644 --- a/elf/dynamic-link.h +++ b/elf/dynamic-link.h @@ -188,10 +188,10 @@ elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[], do { \ int edr_lazy = elf_machine_runtime_setup ((map), (scope), (lazy), \ (consider_profile)); \ - ELF_DYNAMIC_DO_REL ((map), (scope), edr_lazy, skip_ifunc); \ - ELF_DYNAMIC_DO_RELA ((map), (scope), edr_lazy, skip_ifunc); \ if (((map) != &GL(dl_rtld_map) || DO_RTLD_BOOTSTRAP)) \ ELF_DYNAMIC_DO_RELR (map); \ + ELF_DYNAMIC_DO_REL ((map), (scope), edr_lazy, skip_ifunc); \ + ELF_DYNAMIC_DO_RELA ((map), (scope), edr_lazy, skip_ifunc); \ } while (0) #endif --RnhtzxQ6j1IuTAOg--