Skip to content

Commit 87dfb2d

Browse files
committed
export-file-local-symbols: help output and handling of large files
goto-cc --export-file-local-symbols was never documented in --help output. Its use entails renaming of file-local (function) symbols with a prefix of __CPROVER_file_local, which had the side effect of those names being added as defines when building hybrid binaries. For files with large numbers of static functions, this resulted in a command-line that exceeds operating-system limits.
1 parent f649c47 commit 87dfb2d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/goto-cc/compile.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,9 @@ bool compilet::add_written_cprover_symbols(const symbol_tablet &symbol_table)
746746
if(!(has_prefix(id2string(name), CPROVER_PREFIX) && new_type.id()==ID_code))
747747
continue;
748748

749+
if(has_prefix(id2string(name), FILE_LOCAL_PREFIX))
750+
continue;
751+
749752
bool inserted;
750753
std::map<irep_idt, symbolt>::iterator old;
751754
std::tie(old, inserted)=written_macros.insert({name, pair.second});

src/goto-cc/goto_cc_mode.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ void goto_cc_modet::help()
6363
" --native-compiler cmd command to invoke as preprocessor/compiler\n"
6464
" --native-linker cmd command to invoke as linker\n"
6565
" --native-assembler cmd command to invoke as assembler (goto-as only)\n"
66+
" --export-file-local-symbols\n"
67+
" name-mangle and export file-local symbols\n"
68+
" --mangle-suffix suffix append suffix to exported file-local symbols\n"
6669
" --print-rejected-preprocessed-source file\n"
6770
" copy failing (preprocessed) source to file\n"
6871
" --object-bits number of bits used for object addresses\n"

0 commit comments

Comments
 (0)