From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by sourceware.org (Postfix) with ESMTPS id 6A5973858D3C for ; Mon, 22 Jan 2024 12:12:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A5973858D3C 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 6A5973858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b2d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705925531; cv=none; b=UE6yAvrLpdnQuNcwJeDe6GIuXnWbYZEDfnw5ri0Of3tHu76fXG3FVdOQzMAKjjD3uDIBnPe3Y1DP/edaA1D96F2vNCSdlSWsTc3CfggIfQ2nR7BIfWKo/XDQueDaNt+rdS8R74wDSHj+/Ao6ntDsIdoelklIHgrlrJG7lILBDqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705925531; c=relaxed/simple; bh=f/cBYLuLG949waj2gzWb+u9seJDY0r34pY2i5ybh45E=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=WAKYt6PvvNKC4q6XsFKKS6DeaXKOAYKxF7/4jAWwQ0/HH4FprFGiGAK92pL0/FDeHAWC4r4WCarJwKXJEtSKNla9pFous82pFZb/H9uQYnaWwDrODky1qYkjjYv1/xjJQpmFNPgabHBaXMDgyeQjXzTnogPt94It1J8d13pcuyk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-db3a09e96daso2351572276.3 for ; Mon, 22 Jan 2024 04:12:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fluendo.com; s=google; t=1705925528; x=1706530328; 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=f/cBYLuLG949waj2gzWb+u9seJDY0r34pY2i5ybh45E=; b=YhnX3ooO99MfZRyBFp0t+t3jL3hPY7VcOWb9JV2Y/6lH0Th5ywc6o6crxFFuU7Xudq VcrYDTNEFZNsmXg7n0I6qJ9qb2J+UtxLxBLr2AAYk3xT6KYA9ge+Epp6A//3GQjANUmh HeIW5Qp1EVozL+MOarddjLDhRIKdz1/MFFJrE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705925528; x=1706530328; 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=f/cBYLuLG949waj2gzWb+u9seJDY0r34pY2i5ybh45E=; b=U0k5JX8aGdbGx67PqMAVAodkLT7EmFw/B30jRaWvr0pUQofQYOf4Yz2TFhrOsZeVfv HmRxLB8hIsg60z4ZFGLHt+yqA9d9eWcFBuCSNSOuFlA7nVpPr5lFTePwHiVfyVVx4bn0 pebRVgfLC5T1QJwwRgPz0WludXOUmzfYMeeK2QRrATDh7J1YfAbVoDH8l7SY872ADu6u ag9D9nstWkwWflykVeMmdWq9mJhDIzJb/T9V7fxK9QBMrf3Q/X84Uyhoj3tNpD5FMZhC 4MNlcYZ0Guo/aCDe6MKUOjt7kE4P4CHprMes3bzHlU0dCOnTp066kgQ2Dhpt+/gDRU2v //Jw== X-Gm-Message-State: AOJu0Yx0V8EPirVTQTTvCJIXCINc5YJXHn05dzKU0OEVjkt7J4lkg6L3 EI0EfVdir+bpsMKJ8TIT1j7YCeqMOqGZX6MLW2lqODZMDnR4PbkzTpt+YEGB4LVXk6l7/oshauI if/EEGVSu8cxxGwBDmyQieiYz7Yxma26BHiw7io32L8vX4/CyqHD3oq0jvPQ1n6Bl8pO9a4qnmI K5P0u4aATYFIf0CpF3Md9XDOw+EvB4D4gW6rhr X-Google-Smtp-Source: AGHT+IFuNvMNIx0ky0XJu4K00T/0WEAeLzhvA2+XIKtmEOCxRUr/RZ9uM/STiouVZtKEONBtW5NZrx4UUjWazHarZ1U= X-Received: by 2002:a25:ac57:0:b0:dbe:d3ef:d54b with SMTP id r23-20020a25ac57000000b00dbed3efd54bmr2149585ybd.93.1705925528389; Mon, 22 Jan 2024 04:12:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Maxim Dementyev Date: Mon, 22 Jan 2024 13:11:57 +0100 Message-ID: Subject: Re: readelf --string-dump analog for objdump To: Jan Beulich Cc: binutils@sourceware.org Content-Type: multipart/alternative; boundary="000000000000221a33060f87bd17" X-Spam-Status: No, score=4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_IMAGE_ONLY_28,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: --000000000000221a33060f87bd17 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Jan, Thanks for pointing me out the objdump utility! Unfortunately, --only-section isn't a good choice: it produces all other information in the output file, not only the section in question. But I've found the need option of objdump utility: --dump-section Unfortunately, apart from this, again, the objdump utility creates a formatted file as an output, and I can add --only-section to reduce the size of it and redirect it to /dev/null. So, this is usable with one intermediate file for a section. But it is much more complicated than just: "readelf -p section file | grep something". And a possible solution (how to improve the objdump utility in a generic way) could be a special value for the --dump-section option to produce the output only for this section instead of redirecting it to a separate file: "objcopy --dump-section section=3Dstdout | grep something" Thanks again! With respect, Max On Mon, Jan 22, 2024 at 11:58=E2=80=AFAM Jan Beulich wr= ote: > On 22.01.2024 11:43, Maxim Dementyev wrote: > > The readelf utility has a very useful option - "--string-dump=3D > name>" which displays the contents of the indicated section as is (as > > printable strings). > > As far as I can understand, to do the same with the objdump you need to > do > > "objdump --section=3D --full-contents ...". > > But the output is in the "hexdump" format, the contents is splitted by > 0x10 > > size blocks (so, not possible to grep on this contents). > > > > Is there any plans to implement a printable strings format for this case > > for the objdump utility? > > Or is there a solution without parsing the hexdump format and restoring > > these printable strings? > > From what you write I can only guess that you'd like to use the > functionality > on non-ELF objects which binutils as whole (and maybe objdump in > particular) > supports. If so, is there a reason you can't extract the section(s) in > question using "objcopy --only-section" (e.g. as a raw binary file), and > then > use "strings" on the result? > > Jan > --=20 --000000000000221a33060f87bd17--