Discussion:
Types table size and format in the .gcc_exception_table
Shahid Alam
2013-01-07 21:13:36 UTC
Permalink
As part of my research I am updating the .gcc_exception_table of a
binary 64 bit elf file. For small C++ programs that throw exceptions it
works OK, but for large benchmark programs it's not working. My question
is does GCC stores more than one table inside the .gcc_exception_table
section of the elf file. If it does what's the exact format of these
tables. I have some knowledge of the action table, action records and
types table. I am not clear about the size of the types table.

I am parsing the tables in this section but is not able to know the
exact size and format of the types tables, where a pointer to the
exception information is stored. I need to update this pointer to the
new updated location.

Any help is appreciated.
Thanks,
-- Shahid
Ian Lance Taylor
2013-01-08 06:53:15 UTC
Permalink
As part of my research I am updating the .gcc_exception_table of a binary 64
bit elf file. For small C++ programs that throw exceptions it works OK, but
for large benchmark programs it's not working. My question is does GCC
stores more than one table inside the .gcc_exception_table section of the
elf file. If it does what's the exact format of these tables. I have some
knowledge of the action table, action records and types table. I am not
clear about the size of the types table.
I am parsing the tables in this section but is not able to know the exact
size and format of the types tables, where a pointer to the exception
information is stored. I need to update this pointer to the new updated
location.
I documented the .gcc_except_table section at
http://www.airs.com/blog/archives/464 .

Yes, there is normally more than one table (one LSDA) in the
.gcc_except_table section. There is normally one LSDA per function
that needs to handle exceptions. Each such function will have a
pointer to the LSDA in its FDE entry in the .eh_frame section, as
described at http://www.airs.com/blog/archives/460 .

Ian

Loading...