From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) by sourceware.org (Postfix) with ESMTPS id DEC85385B836 for ; Mon, 30 Mar 2020 17:43:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DEC85385B836 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jimw@sifive.com Received: by mail-ua1-x929.google.com with SMTP id 9so6585355uav.12 for ; Mon, 30 Mar 2020 10:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6DbWaCUdRKOZsEjZ3n8yfQu1UOTmbBWq5+bklsldfd4=; b=f00WSQ4mVWHpWaG1WncQ92wEG0xuFYrbY9UJIGw8y8dRDdi+et5+/ClbPKAVCMvPAO Y/aID7FsWEuPCPwrrrBx0mMqkuTZK5Xm6Ms/anE6JQ2i8LqGyM+Tizc9jAjCNM6MHThl w8rJkbsNS5mwRMYEgDK9KBJx9Ri99ZW8N/NyDgMXeFUQ3DlQYH3Ccbv4q0LgijpZWaye QwPHbPG0+G99ADMumoQ+Ry4VyI7epJuk8WUlwvi/dDsZkxzdZdW+0Iy3DNMmj4Lco+An ObH0FpVZyQD5zWnWmRhD1IDv/PjC0+88rXgBpWw6t0dQOMeXJZjkxIOosNHQJBD5y82l I8Cw== 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=6DbWaCUdRKOZsEjZ3n8yfQu1UOTmbBWq5+bklsldfd4=; b=AfQrAY5STiPO/RtGG6KD6LczzsAEsI9YKJN7xWTKkgDVYWLZMsb8tPGuWtUVASpOgk Z8v8P5sl/yoaw56gasjb2r84NFtFRTFMJSHG26Y2MGGV9hYcHJxxGMj9gnfW1+E3EwWD DcfXnFhPGSGMLHYel3nQzW+Fflef110sx+xVrHwPa2/CEMAyeNbRSzhayKw2NHmz89b7 clbzHt7WdNsfqwa89qOAR5bBJRMkJ7CpHFK4NroowiwJsaiNisLzbkim0biuLhAtGQSn w/TNUeoh6Tu9C2NoBQHzXp4E5OYDJvjo9rkIBKXIPD/LZAg1RFnKfMZoRXXuI+m94ipV i3Zg== X-Gm-Message-State: AGi0PuYj1TWJKHnHUb9Y1BhS5BAVYeJv0IOTEV7Ai6ARezt5+Hbri62W Y068jlfdxGOzW4IU1aAdQXP8rsg1yxxLxGKirsu0ew== X-Google-Smtp-Source: APiQypJC93mPUOvYhnbAomLSi7rUCqFcJeXUmf4iMh1GllXx4/FTAq+rZOiNbQIoC4npcPXeZZOdnsDJSDs5Iz3FKbM= X-Received: by 2002:ab0:70d9:: with SMTP id r25mr9118257ual.67.1585590233665; Mon, 30 Mar 2020 10:43:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jim Wilson Date: Mon, 30 Mar 2020 10:43:42 -0700 Message-ID: Subject: Re: GCC generating symbols prefixed with "call_" To: William Tambe Cc: gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: 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: Mon, 30 Mar 2020 17:43:56 -0000 On Thu, Mar 26, 2020 at 5:03 PM William Tambe wrote: > Any idea why asm (__LIBGCC_TEXT_SECTION_ASM_OP__) is used instead of > asm (".previous") to restore the section before the use of asm > (SECTION_OP) ? Probably not all assemblers support previous. All GNU as ELF targets do. But I think GNU as COFF targets don't, and there may be vendor assemblers that don't. But why are you worried about the call symbols anyways? I think that this code is never run. The purpose here is to put a call in the fini or init section, and the rest of the code is irrelevant. This is a trick to support init/fini. Most targets nowadays use init_array and fini_array instead of init/fini. init/fini were obsoleted in the ELF standard about 20 years ago. This results in a much cleaner implementation, and allows but better unwinding e.g. better C++ EH support. You should be using the init_array/fini_array support here. I would suggest looking at why this doesn't work. There should be a configure test to check for assembler support for init_array/fini_array, and it should pass for any elf gnu as port. Jim