[patch] Ignore relocations from .eh_frame for gc

Cary Coutant ccoutant@gmail.com
Wed Apr 22 19:42:00 GMT 2015


> 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



More information about the Binutils mailing list