Bug 28541 - unstable cie offset in the output of readelf
Summary: unstable cie offset in the output of readelf
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.38
: P2 normal
Target Milestone: 2.38
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-04 10:24 UTC by Shaohua Li
Modified: 2021-11-05 12:27 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
diff_cie.o (5.28 KB, model/x.stl-binary)
2021-11-04 10:24 UTC, Shaohua Li
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shaohua Li 2021-11-04 10:24:16 UTC
Created attachment 13757 [details]
diff_cie.o

Hi there,

I found that, for some inputs, the cie attributes would change per run in `readelf -w`.

- Compiler: clang13

- Platform: Ubuntu 20.04.3 LTS, x86_64

- Reproduce: run `readelf -w diff_cie.o | grep cie`, you'll find one of the cie attribute changes per run.
Comment 1 Shaohua Li 2021-11-04 10:42:26 UTC
BTW, address, undefined, and memory sanitisers didn't complain.
Comment 2 Sourceware Commits 2021-11-05 12:26:36 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ca8775833bb6af8eb4333f41e4f8672df0ead874

commit ca8775833bb6af8eb4333f41e4f8672df0ead874
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Nov 5 21:26:16 2021 +1030

    PR28541, unstable cie offset in the output of readelf
    
    Calculating "0 - pointer" can indeed result in seeming randomness as
    the pointer address varies.
    
            PR 28541
            * dwarf.c (display_debug_frames): Don't print cie offset when
            invalid, print "invalid" instead.  Remove now redundant warning.
Comment 3 Alan Modra 2021-11-05 12:27:26 UTC
Fixed