| Message ID | ffa348aa-ecc1-4a3f-997a-c3e14478d013@suse.com |
|---|---|
| State | New |
| Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5941D4BB593D for <patchwork@sourceware.org>; Fri, 31 Jul 2026 09:50:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5941D4BB593D Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=NYYwMSm+ X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id F0B694BA2E39 for <binutils@sourceware.org>; Fri, 31 Jul 2026 09:49:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F0B694BA2E39 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 F0B694BA2E39 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785491396; cv=none; b=M9zqyvxOYrlN48dCZ3/Whmg9x2t2j0vtRoFRQK22Lga8naxfw+EC//n7D5oQhjKKVPfjFD2yd+htYy13nxk1276C7z7fdkWcmESpbk5i8U1QwR9ByeJmJE2Z4+9D4xR4lJdbJjcpvpm9EBJNNI8sYTQrBkpiqVlIMTrAqi1ugTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785491396; c=relaxed/simple; bh=OVVmvKKhcoiRfANsTogB6d1Ql4RwEPdK2nzMRxpdRME=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=WByjcJedYWJn03erY5awEMArA9+avSuZJe16st/s37tpsxwl7QXpum6HDmfrVhbhvGa6Edb4u0FAlbpBqmwx/D7RIybEaiKstIvJY69xjAZgE8PlfYN7BmcPhlrwY19J53UcAnxt+aNLnE0dDRzvk1gDTweB0ry6WFoma/RviJg= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=NYYwMSm+ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0B694BA2E39 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-47f703a9d05so480484f8f.0 for <binutils@sourceware.org>; Fri, 31 Jul 2026 02:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1785491395; x=1786096195; darn=sourceware.org; h=content-transfer-encoding:content-type:autocrypt:subject:from:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=9w0pC3QkCtsvjlZWkdlxrMmk9neIMd8ov8Blg5Dg5lo=; b=NYYwMSm+wWqs3Mi++VZBbbnhl1nyC5rcFOYd8OLnIXlO15W037feXjFrcncIjhg+/l HE45VI8+9Oe6hwOAUSIYnozNW8DyGpppyxHudFQSSVeMmV47cqqTtV55H8Yu9dYO679j FzMxv/esdgF8DxmrOXnPY5AJndqXrth50WZXlmG/J/a+WRsRlA+mBimlcEvrYTbhiH4i 4dY88tN6k86TJMupCG6O9eXqzMtwjg5P+RbMNNuZaUOqBTu3FKAPpymGyufy6OXroyKT YPAsInuzilMPnPwuue1cnQaRqYaknukArcjGetNG0LEq378lPe33VT7iwzPYwnIMhKuH i9YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785491395; x=1786096195; h=content-transfer-encoding:content-type:autocrypt:subject:from:to :content-language:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9w0pC3QkCtsvjlZWkdlxrMmk9neIMd8ov8Blg5Dg5lo=; b=U8TgCPO497cvbdt32HKzBB0TsOzmIWz6y0FY9Nd/DF/yne5errOm2VadZSz4XQpqEZ 04RTPcguSybtaaCLH5gWrhI9+TYFR0bHOYw7jsZlIzPEX5egItt/Qob/gKxlUjGiK/kp OUa2ogEr8Itt8juGescqAkt3/BVMHIHHI1/Gie2giGOTFAErKAqvovyvgT3YfjpziR9R rS7cd6oCvOYdKlnEzAYLkSSB2pYHXtSyI9NDgT0Oywu5tH990TtJe5SXJTrxZKn5d6/Z 8YPuMjqsGDuV9KqJ5YjGlknOXay1G/4A7nLZHEkphgqNgimYYnxPGpzDMvjJ9hYRooOC Fs/w== X-Gm-Message-State: AOJu0YyVzJD5XmRLvSzXtgRohsNJGmKqguSlqRXIRI35eHPi4YE52nik 1B14sRXhlBjpRfXPqLV9XZHtQRz6daYJkg9z5kNgXBIA0Ag/Weotq+25uEv1qPBUGIH2kiUOBMW 92cwJdg== X-Gm-Gg: AR+sD12KeG8pwekITsun7dG6ClYYXRwq58TGP14SVpVQWYpXjKTR/CKkxbaOsQKnAzn bNcJN6OVFxQnZ8Ek2hjfZUfpfePbLt+Lp8qlJNEojit+s6QDREzzzA/A3RJExGUTZZtwZub2P0Y uTQmwUvTPFTFmafdAC2sHiWLla7vY28blZy2f3U2OPY91C1aIlU8a82MNcMEM0Qnk61yfUfmTyB J3Eqr5tRBmPy9YDLGPudZtrWuRaMwAjUc6WcTXrZt8oEeLNgjNUaNpuUPnNKpgbvlCxBCcpc6De v/BMadDL0Ey3XpxYPrugugmrgwqLMa2Jad3rgC/71q7yqzI1NNVhEgc/BBpo8TMtlOBaZvJbwgk aDEvx7sTnpHjev1nXFhdg1U91oxRoWF223dW2geKw4pzmZr+pBcSNQzh/mE9zQ8gmebmQxkdGwg uS0QBlx1MZaUu8OHYl9Pg/VouDAZHqP5LZsluADHlG5B5yZLguO1Dfsx1T1iISE8XJeKKWjm2Pc ICPG6Kr27n03JdFstG1wR4WhEtFhn9XOKIcok74x3VhnQpEyYpD X-Received: by 2002:a05:6000:46cd:b0:47f:8f5d:182 with SMTP id ffacd0b85a97d-47fd2b7c113mr2223040f8f.61.1785491394897; Fri, 31 Jul 2026 02:49:54 -0700 (PDT) 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 ffacd0b85a97d-47fd41d1a58sm3401024f8f.7.2026.07.31.02.49.53 for <binutils@sourceware.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Jul 2026 02:49:53 -0700 (PDT) Message-ID: <ffa348aa-ecc1-4a3f-997a-c3e14478d013@suse.com> Date: Fri, 31 Jul 2026 11:49:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Binutils <binutils@sourceware.org> From: Jan Beulich <jbeulich@suse.com> Subject: [PATCH] bfd: SEC_DEBUGGING in bfd_generic_get_relocated_section_contents() Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9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/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3015.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
bfd: SEC_DEBUGGING in bfd_generic_get_relocated_section_contents()
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_binutils_build--master-arm | success | Build passed |
| linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 | success | Build passed |
| linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 | success | Test passed |
| linaro-tcwg-bot/tcwg_binutils_check--master-arm | success | Test passed |
Commit Message
Jan Beulich
July 31, 2026, 9:49 a.m. UTC
Unilaterally excluding debugging sections as done by 810b19952d5d ("bfd:
generalize _bfd_elf_merge_sections()") is clearly wrong. I did test
linking of a decent size "real" binary without that, inspecting debug info
to all be fine. Then, upon finding quite a bit of testsuite fallout, I
added the check (as the comment there says, realizing it can't be quite
right) without re-testing on the real binary. Which (of course) ends up
with all broken debug info. Which in turn has become easily noticable in
2.47 due to bfd118583ed6 ("Add --debug-dir option to readelf and objdump.
Load separate debug info files when disassemblng."), resulting in warnings
from objdump doing disassembly of the resulting binary (which is part of
the overall build process there).
The issues spotted by the testsuite (many actually went silently [visible
only when inspecting ld.log], due to overly lax expectations) need dealing
with differently: Like done in the "if()" corresponding to the enclosing
"else" here, special treatment of calls from underneath
bfd_simple_get_relocated_section_contents() is necessary.
---
The SEC_DEBUGGING part of the checks (the one here and the other one
mentioned) still feels wrong (or at least redundant): If
bfd_simple_get_relocated_section_contents() was used on non-debugging
sections, comparing link_info->input_bfds against link_info->output_bfd
would be all that's wanted/needed.
Perhaps non-section symbols also need handling there, when they don't have
BSF_MERGE_RESOLVED set? Yet then that flag doesn't look to be set
consistently (e.g. not in elf_link_input_bfd()).
Similar code exists in _bfd_elf_mips_get_relocated_section_contents().
If MIPS was to support ELF -> COFF or ELF -> PE linking, a similar change
as the original one (with the adjustment here) would need doing there.
--- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -8148,8 +8148,9 @@ bfd_generic_get_relocated_section_conten { if ((symbol->flags & BSF_SECTION_SYM) && symbol->section->sec_info_type == SEC_INFO_TYPE_MERGE - /* This, while apparently necessary, feels bogus. */ - && !(symbol->section->flags & SEC_DEBUGGING)) + /* bfd_simple_get_relocated_section_contents() is special. */ + && (!(input_section->flags & SEC_DEBUGGING) + || link_info->input_bfds != link_info->output_bfd)) { asection *sec = symbol->section;