1 // ehframe.h -- handle exception frame sections for gold -*- C++ -*-
3 // Copyright 2006, 2007 Free Software Foundation, Inc.
4 // Written by Ian Lance Taylor <iant@google.com>.
6 // This file is part of gold.
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 3 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 // MA 02110-1301, USA.
23 #ifndef GOLD_EHFRAME_H
24 #define GOLD_EHFRAME_H
31 // This class manages the .eh_frame_hdr section, which holds the data
32 // for the PT_GNU_EH_FRAME segment. gcc's unwind support code uses
33 // the PT_GNU_EH_FRAME segment to find the list of FDEs. This saves
34 // the time required to register the exception handlers at startup
35 // time and when a shared object is loaded, and the time required to
36 // deregister the exception handlers when a shared object is unloaded.
38 // FIXME: gcc supports using storing a sorted lookup table for the
39 // FDEs in the PT_GNU_EH_FRAME segment, but we do not yet generate
42 class Eh_frame_hdr : public Output_section_data
45 Eh_frame_hdr(Output_section* eh_frame_section);
47 // Set the final data size.
49 do_set_address(uint64_t address, off_t offset);
51 // Write the data to the file.
53 do_write(Output_file*);
56 // The .eh_frame section.
57 Output_section* eh_frame_section_;
60 } // End namespace gold.
62 #endif // !defined(GOLD_EHFRAME_H)