[RFC PATCH v2] readelf: Add -G/--got-contents options

Jan Beulich jbeulich@suse.com
Thu Aug 28 06:30:34 GMT 2025


On 28.08.2025 04:04, H.J. Lu wrote:
> On Wed, Aug 27, 2025 at 08:28:27AM +0200, Jan Beulich wrote:
>> On 27.08.2025 04:45, H.J. Lu wrote:
>>> On Tue, Aug 26, 2025 at 02:53:40PM -0700, H.J. Lu wrote:
>>>> Add -G/--got-contents options to readelf, inspired by the similar option
>>>> on Solaris, to display the contents of GOT sections:
>>>>
>>>> $ readelf -G libfoo.so
>>>>
>>>> Global Offset Table '.got' contains 5 entries:
>>>>  Index:    Address       Reloc         Sym. Name + Addend/Value
>>>>      0: 000000002fc8 R_X86_64_GLOB_DAT bar + 0
>>>>      1: 000000002fd0 R_X86_64_GLOB_DAT __gmon_start__ + 0
>>>>      2: 000000002fd8 R_X86_64_GLOB_DAT _ITM_registerTMCloneTable + 0
>>>>      3: 000000002fe0 R_X86_64_GLOB_DAT __cxa_finalize@GLIBC_2.2.5 + 0
>>>>      4: 000000002fe8                   0
>>>>
>>>> Global Offset Table '.got.plt' contains 4 entries:
>>>>  Index:    Address       Reloc         Sym. Name + Addend/Value
>>>>      0: 000000002ff0                   2dd0
>>>>      1: 000000002ff8                   0
>>>>      2: 000000003000 R_X86_64_JUMP_SLO printf@GLIBC_2.2.5 + 2c0
>>>>      3: 000000003008                   0
>>>>
>>>> Any comments?
> 
> Thanks for your feedbacks.
> 
>>
>> In principle a good thing to have, yet still a couple of remarks. First:
>> No matter whether Solaris allows -G, as in a similar recent case I'm
>> unconvinced we want to use a scarce resource (signed letter options)
>> for something that's probably not going to be used very often.
> 
> The most useful readelf features have been implemented.  What other
> unimplemented features which are more useful than dumping GOT sections
> and may use the -G options?  Option compatibility with other readelf
> implementations help our readelf users.

We simply don't know what is to come. Also see Maciej's reply.

Jan


More information about the Binutils mailing list