From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by sourceware.org (Postfix) with ESMTPS id E5E363858D3C for ; Mon, 22 Jan 2024 18:03:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5E363858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=fluendo.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fluendo.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E5E363858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1135 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705946637; cv=none; b=g4aJm+LeyvKTvpyCOmn9X5bhxKt/CeORpJN3IWsm/WZHeD/rIPytkiBGRfrXAPLRi9fzQlDLh/OuF7ym011PkKZ1xdvRl6d7bSudPasikpIlf4ypta9jnggTu0kFlCDOTAg9mdyVI5pWiTCbY8ftY+EhNINwsyQjVd6o+udyt60= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705946637; c=relaxed/simple; bh=11jk1JpeWpyxCcI62cI8JN9Yq/InGSleC5G5hksvQqU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=WDR5BzCaG/ZLpMnMghqUtwK2ZTi2TFD1G4HZZTvidDJfbe5YJqz7+jXHmKGbxWzdd3OXjEOW/Ip5CrDPN5MWMebZoJXj5VckP8nYQK+jpKiDRfN6to3mQWkrNuq4R5m1jpLfWRWl7Wcn+9IbwDS02RtlDaivvt4RJ5X4WtYtnG8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-5ffd5620247so14534477b3.0 for ; Mon, 22 Jan 2024 10:03:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fluendo.com; s=google; t=1705946635; x=1706551435; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ry99Ob5LaDHPl5VkeZ4MQXobFEzKPrgep1pvhHmms90=; b=ao851rH46rxf9dQMzVZbm00lYdNBE4IHbD9CdBJBvKz5/6kjtDv/ZnZZMaClWeZJOF /DbsSTDjpjJF23SenH+2/7kQ91xbixYS4gSa16oTTMDseJv2p1bfGn9JNH6E5MUx3nY6 S5lTpDLhocrKVrYC+MPrp0YHpPw3yo5WZxI3c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705946635; x=1706551435; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ry99Ob5LaDHPl5VkeZ4MQXobFEzKPrgep1pvhHmms90=; b=xSIoGBw3xZfz4fTpZzSNAwOVJAXjNpVquoeVpxlmbWpLn13aVqwKSGYzmyZW+677vX pvLIJdQGkCMzgRiUnbhBqig5Rd7aaGATDHifY6+ArYP6q8skI0vK9FBu/k0qEGHfGTpC oLWe0xIBAe2Jp9adlaYkcSVWN2kjjhGaq9UCUHyuNrGLprp06/AUnP0/Ivx7N03+L0Xi rcNba9Oi8EyQTpHuAja6IAi6ManwbBVEZa0/YCeMRbbQfZlJpDW0l/+3Vav52yGkzmWO 4blQdNOMHxlnp4lp8T74bFgPTLrz86eEshRkKZn4tGo50AITmPQvWgXJHJPZhUDd38av iK8g== X-Gm-Message-State: AOJu0Yxp7ufNf/6ob3YHH+T8tqST4uKuGtsRzirE7t3j03038PCm1Utl RpmmGOJHG/SB1WlNvzVCTvuanne1Zx/JdlE/cK6C2ysiV7R+JasjhDc510IsDd4jyhhSHlhnw4d oAKzIiIYkMFd7Z1qxLqJpO/PjTVKbLIo85fNZGh8MiEfcQHCim5qgg84PGEE9h0Jd/J3ALpAqvS OyU3M6gmZRW6lQF8Q4TIXU4kv20ReYwe0Y8F0/ X-Google-Smtp-Source: AGHT+IF/eTarY/GHAtrbPvQ3OeZ6R74dXP0VbveNx/Ld5stiRBZI2rx9n6cKfQLP1gbyepMnV0+WPpGevkGtl03Za+s= X-Received: by 2002:a81:7208:0:b0:5ef:902b:7c60 with SMTP id n8-20020a817208000000b005ef902b7c60mr4887649ywc.25.1705946634816; Mon, 22 Jan 2024 10:03:54 -0800 (PST) MIME-Version: 1.0 References: <154bbbef-3957-402d-8adb-27f60fc86ca7@redhat.com> In-Reply-To: <154bbbef-3957-402d-8adb-27f60fc86ca7@redhat.com> From: Maxim Dementyev Date: Mon, 22 Jan 2024 19:03:43 +0100 Message-ID: Subject: Re: readelf --string-dump analog for objdump To: Nick Clifton Cc: binutils@sourceware.org Content-Type: multipart/alternative; boundary="0000000000002ca68b060f8ca744" X-Spam-Status: No, score=3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_IMAGE_ONLY_24,HTML_MESSAGE,KAM_BADIPHTTP,NORMAL_HTTP_TO_IP,NUMERIC_HTTP_ADDR,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_REMOTE_IMAGE,T_SCC_BODY_TEXT_LINE,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --0000000000002ca68b060f8ca744 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jan 22, 2024 at 6:42=E2=80=AFPM Nick Clifton wro= te: > > Or is there a solution without parsing the hexdump format and > > restoring these printable strings? > > I take it that you need to restrict the output to strings found in > just one section ? (Otherwise you could use the "strings" tool). > > Actually talking of the strings program it might be a lot easier > to augment this tool to restrict its output to a specified section. > It already has a function called strings_a_section() which decides > if a given section should be scanned. It would not take much to > enhance this function to test for a named section... > Thanks for your suggestions, Nick! In fact, as Jan already mentioned, I can get the contents of the named section with the help of objcopy --dump-section secname=3Dsecoutfile ... And I need redirect the output to null (I don't need it), because I cannot get raw output for this section by using --output-target, see my reply https://sourceware.org/pipermail/binutils/2024-January/132041.html This solutions needs an intermediate file in the comparison with non-platform-independent solution, but more simple: readelf -p secname | grep sometext And I don't need the strings utility, because I know the content of this section is a ASCII text with spaces that was added with the command: objcopy --add-section secname=3Dsecfile --set-section-flags secname=3Dnoload,readonly ... Regards, Max > --=20 --0000000000002ca68b060f8ca744--