From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id 30D323858403 for ; Sun, 2 Jan 2022 16:06:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30D323858403 Received: by mail-ed1-x52c.google.com with SMTP id n30so15157387eda.13 for ; Sun, 02 Jan 2022 08:06:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=WSCC5gl7rb6fc6ufukqPuvSXNgtTHX7c4u1C45xsoj0=; b=oH9IpHkRumMRa8huKgKOLd+Wgm4S/K3ilItAkdVbEvL+U5wM0S4Zh2XYvxQ3fQdZq6 czbhnFhOHHWP1e52DYOx/elmE1QiARfF5vpVZ36Vl0yJr+jKMnolROl4e+X2bXS1RssI hb/vjvLHTN0UU7/D0mczI82+lU1mWA4/8toJU6PMsRZNji8D76LAcsC04pIrsJO3y4Zw qTNe0NNxAxzKcqmA61ZWFl2uiqTC9Ud98HYo5meagd1VhyFJbU7irHoRnpM1sDz0lBNV 98C7hHkGJKSA5nR0wyosSVk+oDQi9uVPtsnIZx0znAkd6OfxZzSEHF/Xb+1UjMQ3srPE j/Ew== X-Gm-Message-State: AOAM530F/F/T6ZNGP/uURO7AwRkOBhruMtdHegz6mberhyqBupTxnqpB AylwBWmN74dARnsS7MWSOqZUFjlR/+8vKuRxttbPUJokcJc= X-Google-Smtp-Source: ABdhPJxd5WZ5P/kJF2pb9huLf5OdoH8OeyQbYbwKL7RMXqWxP6GPCfZXky8kj6fH/jEt3n029+6ZT9M2JLl9WejGmMk= X-Received: by 2002:aa7:db06:: with SMTP id t6mr38398093eds.413.1641139601946; Sun, 02 Jan 2022 08:06:41 -0800 (PST) MIME-Version: 1.0 From: Tom Kacvinsky Date: Sun, 2 Jan 2022 11:06:31 -0500 Message-ID: Subject: How to tell if a ELF library/executable was built with -fpic versus -fPIC To: gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2022 16:06:45 -0000 Perhaps this belongs on the binutils list, but I'd like to know how if an ELF library/executable was built with -fpic versus -fPIC. I know each makes PIC object code, with the difference being the size of the data model: -msmall-data (-fpic) -mlarge-data (-fPIC) but I have some shared libraries I am linking against such that I don't know which PIC option was used to build it. Is there an ELF header I can check? If this is the wrong list to post this, I will redirect to the binutils list. Thanks, Tom