-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'junghee/lsda-boundary-sym' into 'main'
Add boundary_sym_expr for lsda entry with symbol pointing to the end of section Closes #599 See merge request rewriting/ddisasm!1192
- Loading branch information
Showing
7 changed files
with
79 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CXX="g++" | ||
EXEC= | ||
|
||
all: ex.cpp | ||
# NOTE: `-T linker-script.ld` | ||
# This is to place .gcc_except_table *before* .note.gnu.build-id | ||
# so that the reference label for the end of the section is aligned | ||
# with the adjacent section. | ||
# | ||
# With this example, if a boundary_sym_expr is not correctly created | ||
# for symbol_minus_symbol, the assembler will fail with | ||
# "Error: invalid operands for '-'" | ||
$(CXX) ex.cpp $(CXXFLAGS) -T linker-script.ld -o ex | ||
@ $(EXEC) ./ex > out.txt | ||
clean: | ||
rm -f ex out.txt | ||
rm -fr ex.unstripped *.s *.old* dl_files *.gtirb | ||
check: | ||
@ $(EXEC) ./ex >/tmp/res.txt | ||
@ diff out.txt /tmp/res.txt && echo TEST OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <exception> | ||
#include <iostream> | ||
|
||
int main() | ||
{ | ||
try | ||
{ | ||
throw std::logic_error("This is a logic error"); | ||
} | ||
catch(std::exception& e) | ||
{ | ||
std::cout << e.what() << std::endl; | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SECTIONS { | ||
.gcc_except_table : { *(.gcc_except_table) } | ||
} | ||
INSERT BEFORE .note.gnu.build-id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters