From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 4F6213858D38 for ; Tue, 19 Dec 2023 09:36:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F6213858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4F6213858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::634 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702978573; cv=none; b=dYYeToD5D3Ql/manbGSdLfNp6wEUtpAwUvJpjB0tFNr0/gmEsxHUYtZdaEAA6YQxPYj2v94g3tq6mh9j9kc2j7fuuKKqTo/auXJZoz5wd+HhHlHwYBF3YoASXobLREbwZzL3xV6v9MIhIszBnPUVy2Ikp384U6i3jMiTel6t0ac= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702978573; c=relaxed/simple; bh=+DrAVayHCsVJUZZ2KWiA8v/XyPAF9i8wY0YdJfNis34=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=L+b1IE8PdKal0apvM6bOpLZhxQWUcaNkPwbyWT+YA8r2ZGOvbdX6x3266/AdQ8nG9RXoQELh+wPoPs+B3nsp/AskXMz3uYQlInBVlFfjkcFAFELHVa8Ex5ERYpRzkXTyDLIL+qnX2kQzlmd1a6YV8l/Y+gfHHL9iHvo1mjUrv/I= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1d3ddccfaffso3090505ad.1 for ; Tue, 19 Dec 2023 01:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702978570; x=1703583370; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OmvXzLDUzg2+sBta/HjZFPPYgCtEuF4GUnk75rYnJhQ=; b=Cio3uMGy81PSITOCbwdKOugWt0LwrDld9ZfZ01AYQG2TAtae1ifWjMmSU/QGza3jAI 6Ffbks5CEYETZYoiGJ5xGoZmIS+JR4ziBbqsAhsx6J/NcgUCQwQpIxaQ1A6kRagG4C8l xC6Hx9pl316RK5hFmukT2fH3Yx1QM+ojO2ZNsvjrHwrcXPaCWCNoBYLLsNLt74+hn8ky hBRbi1jVo6Z3G6PpK3TehqQMXSe2eIioXWkiBvpPDBtbXt4yX+VO2YLH6810Z0Kzy1Np w7vlfwToz5pWaKHanOOeBpkx+0c15W28HzP2I7JjIDAzLWnXcuWEc7KDD9Cn3vdk+IRl gJFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702978570; x=1703583370; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OmvXzLDUzg2+sBta/HjZFPPYgCtEuF4GUnk75rYnJhQ=; b=IZtsmXtyt7gxGuDl6xjN9b6KnY7F2MHlaVNwB8KdnXxKx8Qjag+RalhaLxmFHHDIxt N2yZ0aFiueisH8wXkCgDktX2UOwH3bcW0fEa+yuCUVn82zRb2GpjnmDWzdJcsouWoBij gISDA2sGcIWkZjHK7zzjRZ4aMwSkFeVdoemFgON+c0Gv96FqJAo0oyWhbzlBqUKWLFPP ShMIEnsoD/BTRSffVJ+h0JuSK9wcYUbMzI8HQpitQ9KEk2c6PeR0Tt2aFcUQYeALVhGL TTOckG+0wB5zq6kPkQR0Fo3BxFz649ISXzQUCShP36WZXnhcuWKjf3BdMWqGwm6bO62S Hk4Q== X-Gm-Message-State: AOJu0Yyan4wcv7/UxJ/nOP11fnTSb8FSibGwv7sdzyghkeSMLguQjpOk Oc6hQirsVypaufZ8PK/jPFrZgA0ee2U= X-Google-Smtp-Source: AGHT+IFTIxIaOK8OyOw02+7SCHx/yZGkWmovmkETpyd6Xbqu8G4zAQmfyZQXbMvfFgQbVTUXtiTJ7Q== X-Received: by 2002:a17:902:868f:b0:1d3:b308:adb8 with SMTP id g15-20020a170902868f00b001d3b308adb8mr3115106plo.17.1702978570369; Tue, 19 Dec 2023 01:36:10 -0800 (PST) Received: from squeak.. ([2406:3400:51d:8cc0:f25f:eeff:1565:a817]) by smtp.gmail.com with ESMTPSA id t8-20020a1709028c8800b001c5b8087fe5sm20607075plo.94.2023.12.19.01.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 01:36:09 -0800 (PST) From: Alan Modra To: binutils@sourceware.org Cc: "Maciej W . Rozycki" , Chenghua Xu , Alan Modra Subject: mips hi16/lo16 reloc handling Date: Tue, 19 Dec 2023 20:05:44 +1030 Message-Id: <20231219093546.2112095-1-amodra@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3025.9 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,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 List-Id: In May this year I posted a patch to move the list of hi16 relocs from per-file data to per-section data, where it makes more sense and is not vunerable to fuzzed object file attacks. https://sourceware.org/pipermail/binutils/2023-May/127534.html and https://sourceware.org/pipermail/binutils/2023-May/127535.html These incorporated the results of an earlier discussion in February. A lot was going on in May with mips, so I'm not at all surprised that no one reviewed the patch. Or perhaps a review only went so far as finding a segfault in gas.. That is fixed in this version. We do need to keep struct mips_hi16 "data" field to cope with gas frags. A lo16 reloc might apply to a different frag than the corresponding hi16 reloc. Also, some other infrastructure changes meant that the posted patches no longer apply cleanly. The patches have been tested by running the binutils testsuite, and building and regression testing a current gcc cross from x86_64-linux to mips-linux (no sim installed). Alan Modra (2): Move mips_hi16_list to mips_elf_section_data coff-mips refhi list bfd/coff-alpha.c | 6 +- bfd/coff-mips.c | 121 +++++++++++----------------- bfd/ecoff.c | 34 ++++++-- bfd/elfxx-mips.c | 206 ++++++++++++++++++++++++----------------------- bfd/libecoff.h | 30 +++---- 5 files changed, 201 insertions(+), 196 deletions(-)