This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Ignore relocations from .eh_frame for gc
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Rafael EspÃndola <rafael dot espindola at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>, Sriraman Tallam <tmsriram at google dot com>
- Date: Wed, 22 Apr 2015 12:42:08 -0700
- Subject: Re: [patch] Ignore relocations from .eh_frame for gc
- Authentication-results: sourceware.org; auth=none
- References: <CAG3jReKYU8GWr7Zd-Q9TAVybCMxyxA3w1OgWBebZeBjUmXyp2g at mail dot gmail dot com>
> Looking at a synthetic testcase I noticed that gold will record
> relocations from .eh_frame during gc. This doesn't change the output
> as .eh_frame never goes to the worklist, but it does slows gold down a
> bit.
>
> The attached patch changes the gc code to ignore .eh_frame. Not sure
> if it is worth it the special case. If it is, is this the correct way
> to detect .eh_frame?
I'm not sure it's worth it -- getting the section_name() can be slow,
especially if we're not mmap'ing files, so this test case may not be
representative. Also, I wouldn't expect a lot of relocations in
.eh_frame sections (maybe just one per section?).
At any rate, note that just a few lines below your addition, we do get
the section name if --icf is enabled. You may as well wait until that
point to check for .eh_frame, then you can at least do the check at
less cost when --icf is enabled.
-cary