mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
tool/abi_symbols: omit known internal symbols
This patch prevents the abi_symbols tool from generating symbols that are known to occur in shared objects but must not be part of a library ABI. This saves a bit of time during library-porting work. However, to avoid the accidental use of ABI symbol definitions that lack any form of manual curation, the abi_symbols tool outputs a special message, which is explicitly checked-for by the check_abi tool. Fixes #3112
This commit is contained in:
parent
a155d0e531
commit
7b37546a4d
@ -21,6 +21,14 @@ set demangled [exec c++filt << $symbols]
|
||||
|
||||
set demangled_lines [split $demangled "\n"]
|
||||
|
||||
# obtail list of blacklisted symbols
|
||||
set fd [open "[file dirname $argv0]/internal_abi.list"]
|
||||
set symbol_blacklist [split [read $fd] "\n"]
|
||||
close $fd
|
||||
|
||||
# add notice that the symbols file hasn't undergone any manual inspection
|
||||
puts "# Please review the symbols and remove this line."
|
||||
|
||||
set i 0
|
||||
set output_lines {}
|
||||
foreach line [split $symbols "\n"] {
|
||||
@ -78,6 +86,12 @@ foreach line [split $symbols "\n"] {
|
||||
if {[regexp {W|V} $type] && ($name != $demangled_name)} {
|
||||
set keep 0 }
|
||||
|
||||
#
|
||||
# Drop blacklisted symbols
|
||||
#
|
||||
foreach blacklisted_symbol $symbol_blacklist {
|
||||
if {$name == $blacklisted_symbol} { set keep 0 } }
|
||||
|
||||
# write result
|
||||
if {$keep} {
|
||||
|
||||
|
@ -31,6 +31,16 @@ proc report_error { message } {
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Warn about an ABI symbol definition that was generated by the 'abi_symbols'
|
||||
# tool but hasn't undergone any manual review. This is most likely an
|
||||
# accidental omission.
|
||||
#
|
||||
foreach line $abi_content {
|
||||
if {$line == "# Please review the symbols and remove this line."} {
|
||||
report_error "attempt to use unreviewed $abi_name ABI\n at $abi_path" } }
|
||||
|
||||
|
||||
#
|
||||
# Extract symbol list w/o comments and empty lines, check for trailing spaces
|
||||
#
|
||||
@ -57,26 +67,12 @@ foreach line $abi_content {
|
||||
#
|
||||
# Check for absence of Genode-internal linking artifacts from ABI
|
||||
#
|
||||
|
||||
#
|
||||
# The following symbols may appear in shared objects but should not by part
|
||||
# The listed symbols may appear in shared objects but should not by part
|
||||
# of any ABI.
|
||||
#
|
||||
set symbol_blacklist {
|
||||
__bss_start
|
||||
__eh_frame_start__
|
||||
__exidx_end
|
||||
__exidx_start
|
||||
__l4sys_invoke_indirect
|
||||
_ctors_end
|
||||
_ctors_start
|
||||
_edata
|
||||
_end
|
||||
_init
|
||||
_parent_cap
|
||||
_parent_cap_local_name
|
||||
_parent_cap_thread_id
|
||||
}
|
||||
set fd [open "[file dirname $argv0]/internal_abi.list"]
|
||||
set symbol_blacklist [split [read $fd] "\n"]
|
||||
close $fd
|
||||
|
||||
foreach line $abi_symbols {
|
||||
set name [lindex $line 0]
|
||||
|
13
tool/internal_abi.list
Normal file
13
tool/internal_abi.list
Normal file
@ -0,0 +1,13 @@
|
||||
__bss_start
|
||||
__eh_frame_start__
|
||||
__exidx_end
|
||||
__exidx_start
|
||||
__l4sys_invoke_indirect
|
||||
_ctors_end
|
||||
_ctors_start
|
||||
_edata
|
||||
_end
|
||||
_init
|
||||
_parent_cap
|
||||
_parent_cap_local_name
|
||||
_parent_cap_thread_id
|
Loading…
Reference in New Issue
Block a user