From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id 5365D385702E for ; Fri, 9 Apr 2021 10:17:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5365D385702E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ivan.a.melnikov@gmail.com Received: by mail-lf1-x135.google.com with SMTP id w8so317710lfr.0 for ; Fri, 09 Apr 2021 03:17:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AxczdZzm5NI1v8iIYiDjYYSKFjF+4Vz1LDgtIynQ9/8=; b=pDNgd1HAi8kirHf9RPFWrZUqOA29BdNUjArUjhKHohFQpbwbDOkjF5ehRlnlOsMzOH neJdBM4q5r4wh/HUE1wtM69PLyjCKiAFkjvi694dMFSVRGaLzZIAQgYQhAbjIyMMos6G +nUaxCoK9qe4ip5yCmLlgucyH42Iv1yWBT+X8QWxF7wobhlCuDj6/RcBFuUpFWUpUCUc qiugWxJnee/0HwUqCmYWd8Pdr1WWCbgJo7Z4C8mUxUclCfuC7MH77p+V40kGYC9p8t5/ aFmTzsSGe2od5rWtPGgSkmgAci4sUcVYRDJXNXuBL8aDGf415UU1OCmnNW9bkay8GODs HDyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=AxczdZzm5NI1v8iIYiDjYYSKFjF+4Vz1LDgtIynQ9/8=; b=Bk5i/XSlvPo0y0i7P60yAH6jGz3hkpi3VHsv09Ww/+dAws+M/qIX4CS/zAEj4umDfn s3T2wgpu6Ou/BrT9QSGFnoPIhfsWy8sbwbIiVrJ3tNjozCU2GQRN6iPJNQqNfbzxcHAd rrhdHC5P08cCrSY2qtVBGdc2/buGg02ZtsMJvqDDLz9MbeVCk+gryO5WbjcyzxH6zdxy LIJqAHrLLNRiNdusR10plKgWxPMkjGjfrwVLhKssGrz6Fs2VhnChVZypzyjEq8ZdKNFN VAUf9EZ0RZEfBPgSLdLYw2lNXdbcIJrp6GlMo0/wuUlcJINbnQsgWyll1bwgKScA3Z/n jFxw== X-Gm-Message-State: AOAM532WXezz/VIm0WW6zWC7xrfYL3HJYYyrwkqmmlLPrhRKpgXu9dji uWa3+szTgXOF1pEWdvgWAgE= X-Google-Smtp-Source: ABdhPJw9UG5WtDHlfkZJ4gMNqY+Bvu05TyQdYciFJ0KnsNQJKo7OyqG5v82V3cJzYC2x/n5YfNeq0g== X-Received: by 2002:ac2:4c09:: with SMTP id t9mr9926427lfq.1.1617963426124; Fri, 09 Apr 2021 03:17:06 -0700 (PDT) Received: from titan.localdomain ([193.43.9.4]) by smtp.gmail.com with ESMTPSA id c12sm222163lfb.284.2021.04.09.03.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 03:17:05 -0700 (PDT) Sender: "Ivan A. Melnikov" Date: Fri, 9 Apr 2021 14:17:03 +0400 From: "Ivan A. Melnikov" To: Mark Wielaard Cc: "Dmitry V. Levin" , debugedit@sourceware.org Subject: Re: [PATCH] debugedit: add MIPS support Message-ID: <20210409101703.w7kcyqnaxwalbl5e@titan.localdomain> References: <20210402080000.GA13000@altlinux.org> <20210402230309.GW2685@wildebeest.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210402230309.GW2685@wildebeest.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: debugedit@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: debugedit development mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2021 10:17:09 -0000 On Sat, Apr 03, 2021 at 01:03:09AM +0200, Mark Wielaard wrote: > Hi Dmitry, Hi Ivan, Hi Mark, Sorry for slow reply. > On Fri, Apr 02, 2021 at 08:00:00AM +0000, Dmitry V. Levin wrote: > > From: "Ivan A. Melnikov" > > Date: Fri, 13 Nov 2020 15:51:08 +0400 > > > > According to the specification[1], all MIPS .debug_* sections are > > marked with ELF type SHT_MIPS_DWARF. The format of the section > > data stays the same, so we have can handle e.g. .debug_info > > section as we used to. > > > > As SHT_MIPS_DWARF is from processor-specific range, we have to check > > that we're actually dealing with MIPS ELF file before handling such > > sections. > > > > [1] MIPS Extensions to DWARF Version 2.0. -- Silicon Graphics > > Computer Systems, rev 1.17, 29 Aug 2001 > > > > Refs: https://bugzilla.altlinux.org/39284 > > Signed-off-by: Ivan A. Melnikov > > Signed-off-by: Dmitry V. Levin > > This looks correct. I have pushed it to main. Thank you. > I don't have a MIPS setup to check, but don't you > also need some R_MIPS value for setup_relbuf? The thing is that there are several MIPS ABIs. Our primary target is MIPS32 with o32 (traditional) ABI. With this ABI, RELA relocations are not used, even for kernel modules, so all the relocations in .debug_info sections are "uniteresting", as the comment in setup_relbuf calls them. So, my patch is enough to support MIPS32 systems with o32 ABI. On the other hand, on MIPS64 systems with n64 ABI (the most whidespread ABI on 64-bit MIPS) at least 4 types of RELA relocations are used. They, indeed, should be added to setup_relbuf, and some of them may even require additional handling. I'm looking into that, but I haven't figured out all the details yet. I'll send a patch here when I'll have something. -- wbr, iv m.