From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Aid0GCQUfWACaQAAWB0awg (envelope-from ) for ; Mon, 19 Apr 2021 01:24:52 -0400 Received: by simark.ca (Postfix, from userid 112) id 538DD1F104; Mon, 19 Apr 2021 01:24:52 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C431A1E54D for ; Mon, 19 Apr 2021 01:24:51 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 523AA39558AF; Mon, 19 Apr 2021 05:24:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 523AA39558AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618809891; bh=1ExQAHpeQrIoGWN7xZwvF/gLuzgToC+jTJNEHx3yfJc=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=s+qHcea44m9QUlNAuekZfp2hEIwFwUxNmohRLCYWe6SPO7hnTfFQ8m1FVbngJfMIB iavz98cAYIkuFvbacJMufu/kEMX62o5j73VcwJjPv4UaqBk4jU9DE3gnTXH+YcFgHs 4Ctw8yo4BJ6BoB/ufemFs+y4z7NFV/VFhUTxzTzA= Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id E67293953420 for ; Mon, 19 Apr 2021 05:24:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E67293953420 Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1B27A340E3C; Mon, 19 Apr 2021 05:24:48 +0000 (UTC) Date: Mon, 19 Apr 2021 01:24:47 -0400 To: Jim Wilson Subject: Re: [PATCH 08/24] RISC-V sim: Add brk syscall. Message-ID: Mail-Followup-To: Jim Wilson , gdb-patches@sourceware.org, Kuan-Lin Chen References: <20210417175831.16413-1-jimw@sifive.com> <20210417175831.16413-9-jimw@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210417175831.16413-9-jimw@sifive.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: Kuan-Lin Chen , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 17 Apr 2021 10:58, Jim Wilson wrote: > Add endbrk field to cpu struct. Set it to highest section end address. > Use it for the brk syscall support. > ... > + /* Set endbrk to highest section end address. */ > + phdr = elf_tdata (abfd)->phdr; > + phnum = elf_elfheader (abfd)->e_phnum; the commit message & comments say "sections", but the code isn't operating on sections, it's operating on program headers which define "segments". i know it sounds like i'm being pedantic, but i've seen a lot of ELF parsers that get confused and use/mix terminology, and it gets hard to untangle the intentions with the actual code. especially when digging through bug reports. -mike