PATCH: PR gold/14675: No eh_frame info registered in exception_static_test

H.J. Lu hjl.tools@gmail.com
Mon Dec 22 22:40:00 GMT 2014
On Mon, Dec 22, 2014 at 9:37 AM, Cary Coutant <ccoutant@google.com> wrote:
>> Here is an idea.  Does it look OK?
>
> I don't like the idea of making a file named "crtbegin" magic, and
> with this patch, any link *without* such a file will no longer
> optimize eh data.
>
> -cary

How about this?  We do this only when there is a crtbeginT file
on command line?

-- 
H.J.
---
PR gold/14675
* ehframe.cc (Eh_frame::add_ehframe_input_section): Force the
exception frame section from input files if it can't be
optimized.
(Eh_frame::add_ehframe_input_section<32, false>): Updated.
(Eh_frame::add_ehframe_input_section<32, true>): Likewise.
(Eh_frame::add_ehframe_input_section<64, false>): Likewise.
(Eh_frame::add_ehframe_input_section<64, true>): Likewise.
* ehframe.h (Eh_frame::add_ehframe_input_section): Add a
bool parameter to indicate if the exception frame section
can be optimized.
* layout.cc (Layout::Layout): Initialize has_crtbeginT_ to
has_crtbeginT and optimize_ehframe_ to !has_crtbeginT.
(Layout::layout_eh_frame): Pass this->optimize_ehframe_ to
Eh_frame::add_ehframe_input_section.
(Layout::make_eh_frame_section): Set this->optimize_ehframe_
to true when processing the crtbeginT file if it is on command
line.
(Layout::match_file_name (const char*, const char*)): New.
(Layout::match_file_name(const Relobj*, const char*): Use it.
* layout.h (Layout::Layout): Add has_crtbeginT.
(Layout::match_file_name (const char*, const char*)): New.
(Layout): Add has_crtbeginT_ and optimize_ehframe_ members.
* main.cc (main): Update layout.
* options.cc (Input_arguments::add_file): Set
this->has_crtbeginT_ to true if there is a crtbeginT file.
* options.h (Input_arguments::Input_arguments): Initialize
has_crtbeginT_.
(Input_arguments::has_crtbeginT): New function.
(Input_arguments::has_crtbeginT_): New bool member.
(Command_line::crtbeginT): New function.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Treat-.eh_frame-section-before-crtbeginT-as-normal-i.patch
Type: text/x-patch
Size: 15240 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20141222/c2d90fce/attachment.bin>


More information about the Binutils mailing list