From patchwork Mon Dec 11 13:09:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 176707 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7034608vqy; Mon, 11 Dec 2023 05:09:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPoiTqT36wa/5qzOUxNtJljcys8141kG+2AOpJquj9DkZ40wTiS0iJ4gs2VBsUQJB/ffjm X-Received: by 2002:a4a:ea17:0:b0:590:6a57:9caf with SMTP id x23-20020a4aea17000000b005906a579cafmr2369955ood.10.1702300169016; Mon, 11 Dec 2023 05:09:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702300168; cv=pass; d=google.com; s=arc-20160816; b=AIfEmvZLByY5SS8xA4W+PdgYz7K+OUf77F/abcpkW22uNowc/thBVm91GTTyA3uifY G4nUrFDvGGo7Y6WHmvE4tldqUgeZuQ1iAw9z18yLIRHoAVEUEmmLHaqZ7LOE/0evG8oN 86NMky1Jm3dscE5d5jlyNKOtggCXYRi1b5HHP1nWcgLA0QPfL1OGHER6MQfcRAW/mzkS yLJHcqrhY+bAPcm4gCj9EyzhOX6sscUpgxcXsyBMemMwBVpvxWcfyfYJ5gLOI6HIhOY4 xbs2arBQOrVR+jjUSJQ5wvUQLKYJ00X8qWXypXs0HzEWAvvxo0vFh9knLPvFkoaTbuWK qltg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:autocrypt:references:cc:to:from:content-language :subject:user-agent:mime-version:date:message-id:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=2zU2L8oyR0tDwzyO76/AJov4rRv/ZINEDRb3/3n+3M0=; fh=5Xzgsfi+BxTA/WBX/8ajZrRB4ZtN7RJCiTegFMT79QQ=; b=lI/n/fS6NkcNMgCHY+MqrOoRntC/thTKO0kKb8MHwVe8vUhqc0cRxmiSJK1eczRXZZ /8/E2X6UaETx408q5jdrVwE6IucVxziZbha0i0Ph62STvSz7UfqT0NZIf5pPGXFReES2 cSBXCWldSCB0BMAERSO3pvWCAtR2igkBdPurYvUq/w9Z1q9FFi54D8XM3fbrGmIFTGs8 m2ez7eeGZ4sSoisfmEUatASdl8j7WDdZ+aZTBwQrcd4pPrkiYASxVGJdnkn00ZRRTXhF FvatIn7hrP/ia+W8fvxwREaS8IGzCxhBP6N7jqAM/CfSBDdjtJSRVdMEQVZK0UEPaMSg la6Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=gDy6AGHI; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id et15-20020a0561221c0f00b004b311385efesi1302630vkb.316.2023.12.11.05.09.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 05:09:28 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=gDy6AGHI; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BAD0C3857B9A for ; Mon, 11 Dec 2023 13:09:28 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 555733858C56 for ; Mon, 11 Dec 2023 13:09:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 555733858C56 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 555733858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::330 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702300164; cv=none; b=GwZUQ/yg8BEwj0WCitMXqmtfID4gOGVxOM6fiAmJLQwRYdYhas8O6kZIQcg39hZyA8KEhq0Z6VoIwsuZgolXLKQsCSok8dP8Xh7PCOIm52tgccMJv2rlfM6vK/hjkW/VqNXytrYJkyaXpJxEK0lqBM5c3zMB6c/gU8IhRgOeBUg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702300164; c=relaxed/simple; bh=JJCJiusZlEzXkg6VUlgkOF1rgyyza+j1YNsFo4ipQPU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=gJdUJPgVI0vJMb7dsBwk/lz+UG1RrwyxUua1o8j6O4bKbhZkQ6Dbpt7+Im8S6dYjMZveWL6qw/a2s5Xmh/dWx7XRnRJZwigny8nFV+mVV76s52cWWnIruxScI3zjX0Ns+ZIvpnMgStQZs0o9GBgs8h6ESlaJALNu6FID27rvj+c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40c2308faedso46599015e9.1 for ; Mon, 11 Dec 2023 05:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1702300161; x=1702904961; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=2zU2L8oyR0tDwzyO76/AJov4rRv/ZINEDRb3/3n+3M0=; b=gDy6AGHI5XM/a0gw4A6pJqsISVdtS5y4Gr5nHTYF5OoYoGMzVsRTl1Gb8qjg7PpyiQ pk/JeThlafCtmVHq9ZPHSs9G5VlvhzBZzfRFjCaRWI6kST0lR0bDBMxL+1Inj9so3UMA BdEFZB7MfVL/JMIQZVsUpl/99xDqDY7EVjkoq0dy7c/SOxYrm22MAJj0i253enPFnVqJ KxeR7LCMLSiSdhKedRKVn71MmlCk3TR0ULP8aFbzh6wtMWji2z/+7EaEn6QAM3HjkdiN 3RdRSv84dI21fTd7p+mL0ffgRApoXiD81brhAVIKmWFHQoIYW0/0Syzz+Uc5SoP1mXJC U8Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702300161; x=1702904961; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2zU2L8oyR0tDwzyO76/AJov4rRv/ZINEDRb3/3n+3M0=; b=iuA2ly4gLAEDjr/2TUEdNquaxLMzB/LL8BrxAsMUUHem04qRpXrrGqDjrrcc2h2QPr r+ClRI1H+BDUhDaymqyFd3k9yEVr1Vg7skt5dAJyFUniHFm/Hje/PdGBo6Btc8vlky9i YnYNtRwD8/axO2Y3v+yE3LpcOO7pxWS4f275MA6//AQFpbdujsP5HmvU/EZv4rSTtnS2 kSxdDQWG+siSKoxCqJEDHjgDwZUEctupUzti+sEFY9Egm/2NLZl2cnJf1tNscHYxA8QG RZphR8Nn9hUHSr8jF/ER7Z8r8y6yvJKSXt4kOql0TYjYBs/Ws08fYGVyqnmmwVUQ8meQ p+MA== X-Gm-Message-State: AOJu0YzZIZEvPdlmepgaLr2hIa2BMPkEs+52mHsGX/C4PgZqN0SQx6KQ rhTj93BLembvYMEa5jFxF1XxqDs5gzDMLM3z8Gs/ X-Received: by 2002:a05:600c:350c:b0:40c:2990:45c7 with SMTP id h12-20020a05600c350c00b0040c299045c7mr2356104wmq.86.1702300161074; Mon, 11 Dec 2023 05:09:21 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id he10-20020a05600c540a00b0040b3829eb50sm12829168wmb.20.2023.12.11.05.09.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Dec 2023 05:09:20 -0800 (PST) Message-ID: <956811de-8605-44da-9429-4107f0bc114f@suse.com> Date: Mon, 11 Dec 2023 14:09:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 2/4] ELF: drop "push" parameter from obj_elf_change_section() Content-Language: en-US From: Jan Beulich To: Binutils Cc: "H.J. Lu" , Nick Clifton , Alan Modra References: <25484cfc-e9d3-4b6b-968d-7642ae53301d@suse.com> Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoS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wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <25484cfc-e9d3-4b6b-968d-7642ae53301d@suse.com> X-Spam-Status: No, score=-3026.4 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784991102207660111 X-GMAIL-MSGID: 1784991102207660111 No caller outside of obj-elf.c cares about the parameter - drop it by introducing an obj-elf.c-internal wrapper. While adding the new function parameter, take the opportunity and change the adjacent boolean one to "bool". --- v2: New. --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -540,14 +540,14 @@ get_section_by_match (bfd *abfd ATTRIBUT other possibilities, but I don't know what they are. In any case, BFD doesn't really let us set the section type. */ -void -obj_elf_change_section (const char *name, - unsigned int type, - bfd_vma attr, - int entsize, - struct elf_section_match *match_p, - int linkonce, - int push) +static void +change_section (const char *name, + unsigned int type, + bfd_vma attr, + int entsize, + struct elf_section_match *match_p, + bool linkonce, + bool push) { asection *old_sec; segT sec; @@ -820,6 +820,17 @@ obj_elf_change_section (const char *name #endif } +void +obj_elf_change_section (const char *name, + unsigned int type, + bfd_vma attr, + int entsize, + struct elf_section_match *match_p, + bool linkonce) +{ + change_section (name, type, attr, entsize, match_p, linkonce, false); +} + static bfd_vma obj_elf_parse_section_letters (char *str, size_t len, bool *is_clone, int *inherit, bfd_vma *gnu_attr) @@ -1488,8 +1499,7 @@ obj_elf_section (int push) } } - obj_elf_change_section (name, type, attr, entsize, &match, linkonce, - push); + change_section (name, type, attr, entsize, &match, linkonce, push); if (linked_to_section_index != -1UL) { --- a/gas/config/obj-elf.h +++ b/gas/config/obj-elf.h @@ -198,7 +198,7 @@ extern void obj_elf_data (int); extern void obj_elf_text (int); extern void obj_elf_change_section (const char *, unsigned int, bfd_vma, int, struct elf_section_match *, - int, int); + bool); extern void obj_elf_vtable_inherit (int); extern void obj_elf_vtable_entry (int); extern struct fix * obj_elf_get_vtable_inherit (void); --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -27775,7 +27775,7 @@ start_unwind_section (const segT text_se } obj_elf_change_section (sec_name, type, flags, 0, &match, - linkonce, 0); + linkonce); /* Set the section link for index tables. */ if (idx) --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -1139,7 +1139,7 @@ obj_elf_vms_common (int ignore ATTRIBUTE obj_elf_change_section (sec_name, SHT_NOBITS, SHF_ALLOC | SHF_WRITE | SHF_IA_64_VMS_OVERLAID | SHF_IA_64_VMS_GLOBAL, - 0, NULL, 1, 0); + 0, NULL, true); S_SET_VALUE (symbolP, 0); S_SET_SIZE (symbolP, size); --- a/gas/config/tc-microblaze.c +++ b/gas/config/tc-microblaze.c @@ -150,7 +150,7 @@ microblaze_s_data (int ignore ATTRIBUTE_ { #ifdef OBJ_ELF obj_elf_change_section (".data", SHT_PROGBITS, SHF_ALLOC+SHF_WRITE, - 0, 0, 0, 0); + 0, 0, false); #else s_data (ignore); #endif @@ -163,7 +163,7 @@ microblaze_s_sdata (int ignore ATTRIBUTE { #ifdef OBJ_ELF obj_elf_change_section (".sdata", SHT_PROGBITS, SHF_ALLOC+SHF_WRITE, - 0, 0, 0, 0); + 0, 0, false); #else s_data (ignore); #endif @@ -282,7 +282,7 @@ microblaze_s_rdata (int localvar) { /* rodata. */ obj_elf_change_section (".rodata", SHT_PROGBITS, SHF_ALLOC, - 0, 0, 0, 0); + 0, 0, false); if (rodata_segment == 0) rodata_segment = subseg_new (".rodata", 0); } @@ -290,7 +290,7 @@ microblaze_s_rdata (int localvar) { /* 1 .sdata2. */ obj_elf_change_section (".sdata2", SHT_PROGBITS, SHF_ALLOC, - 0, 0, 0, 0); + 0, 0, false); } #else s_data (ignore); @@ -303,12 +303,12 @@ microblaze_s_bss (int localvar) #ifdef OBJ_ELF if (localvar == 0) /* bss. */ obj_elf_change_section (".bss", SHT_NOBITS, SHF_ALLOC+SHF_WRITE, - 0, 0, 0, 0); + 0, 0, false); else if (localvar == 1) { /* sbss. */ obj_elf_change_section (".sbss", SHT_NOBITS, SHF_ALLOC+SHF_WRITE, - 0, 0, 0, 0); + 0, 0, false); if (sbss_segment == 0) sbss_segment = subseg_new (".sbss", 0); } --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -16435,7 +16435,7 @@ s_change_section (int ignore ATTRIBUTE_U section_type = SHT_PROGBITS; obj_elf_change_section (section_name, section_type, section_flag, - section_entry_size, 0, 0, 0); + section_entry_size, 0, false); } void --- a/gas/config/tc-msp430.c +++ b/gas/config/tc-msp430.c @@ -622,7 +622,7 @@ msp430_profiler (int dummy ATTRIBUTE_UNU subseg = now_subseg; /* Now go to .profiler section. */ - obj_elf_change_section (".profiler", SHT_PROGBITS, 0, 0, 0, 0, 0); + obj_elf_change_section (".profiler", SHT_PROGBITS, 0, 0, 0, false); /* Save flags. */ emit_expr (& exp, 2); --- a/gas/config/tc-rx.c +++ b/gas/config/tc-rx.c @@ -488,7 +488,7 @@ parse_rx_section (char * name) else type = SHT_NOBITS; - obj_elf_change_section (name, type, attr, 0, NULL, false, false); + obj_elf_change_section (name, type, attr, 0, NULL, false); } else /* Try not to redefine a section, especially B_1. */ { @@ -503,7 +503,7 @@ parse_rx_section (char * name) | ((flags & SEC_STRINGS) ? SHF_STRINGS : 0) | ((flags & SEC_THREAD_LOCAL) ? SHF_TLS : 0); - obj_elf_change_section (name, type, attr, 0, NULL, false, false); + obj_elf_change_section (name, type, attr, 0, NULL, false); } bfd_set_section_alignment (now_seg, align); --- a/gas/config/tc-tic6x.c +++ b/gas/config/tc-tic6x.c @@ -4662,7 +4662,7 @@ tic6x_start_unwind_section (const segT t } obj_elf_change_section (sec_name, type, flags, 0, &match, - linkonce, 0); + linkonce); /* Set the section link for index tables. */ if (idx)