From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vultr155 (unknown [155.138.137.222]) by sourceware.org (Postfix) with ESMTPS id 8FC393858407 for ; Sat, 30 Oct 2021 07:41:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8FC393858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=beta.pyu.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=beta.pyu.ca Received: by vultr155 (Postfix, from userid 1001) id D9FC7140175; Sat, 30 Oct 2021 03:41:12 -0400 (EDT) From: Jeff Andrews To: Subject: Get TLS information without readelf X-Mailer: mail (GNU Mailutils 3.5) Message-Id: <20211030074112.D9FC7140175@vultr155> Date: Sat, 30 Oct 2021 03:41:12 -0400 (EDT) X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_20, FSL_HELO_NON_FQDN_1, HELO_NO_DOMAIN, KAM_DMARC_STATUS, PDS_RDNS_DYNAMIC_FP, RDNS_DYNAMIC, SPF_PASS autolearn=no 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: Sat, 30 Oct 2021 07:41:16 -0000 Hi all. I'd like to use tls (specifically __thread) with g++ but without a standard library. For the moment all my variables are zero initalized. How should I get the TLS memory size? I can see all the information I need in the TLS header after I build the binary by using "readelf -l". I'll need "MemSiz", possibly "Align" and once I have non zero thread locals I'll need VirtAddr and FileSiz. Is there a way to export these as a symbol/global variable?