Closed GoogleCodeExporter closed 9 years ago
On Linux we generate the file with all the symbols in ASan runtime that should
be exported, and pass it to linker via --dynamic-list= option. Is there
something similar in Mac OS X linker?
Original comment by samso...@google.com
on 18 Dec 2013 at 7:17
First option SGTM.
Unlike Linux, on OSX we only need to export these two symbols. Interceptors and
runtime interface symbols are in a separate DSO and unaffected by the binary
link flags.
Original comment by euge...@google.com
on 18 Dec 2013 at 7:48
Original comment by euge...@google.com
on 18 Dec 2013 at 7:49
You can pass along the file with exported symbols using -exported_symbols_list
option. However, since there are only 2 symbols that need to be exported, you
could just list them directly as options to the linker:
-Wl,-exported_symbol,___asan_mapping_offset
-Wl,-exported_symbol,___asan_mapping_scale.
Original comment by zaks.a...@gmail.com
on 18 Dec 2013 at 6:01
We should only pass -Wl,-exported_symbol,___asan_mapping_offset
-Wl,-exported_symbol,___asan_mapping_scale if we know that the exported symbols
are being whitelisted. For example, if there are no "-exported_symbol" on the
command line, adding the as an symbols would lead to other symbols not being
exported.
Original comment by zaks.a...@gmail.com
on 18 Dec 2013 at 11:27
What about -exported_symbols_list? Is it true that if we add it to link line,
all the other symbols won't be exported?
Original comment by samso...@google.com
on 19 Dec 2013 at 8:58
maybe we should disable flexible mapping on Mac?
Then these symbols will be gone.
This is a feature used mostly for experiments and most only Linux.
Original comment by konstant...@gmail.com
on 19 Dec 2013 at 9:02
Let us keep it for now, it may be useful to shrink the shadow memory for 32-bit
apps (think iossim)
Original comment by ramosian.glider@gmail.com
on 19 Dec 2013 at 9:05
Looks like exported_symbols_list has the same behavior as exported_symbol but
is more convenient for longer lists.
From man ld:
-exported_symbols_list filename
The specified filename contains a list of global symbol names that will remain as global symbols in the output file. All other global symbols will be treated
as if they were marked as __private_extern__ (aka visibility=hidden) and will not be global in the output file. The symbol names listed in filename must be
one per line. Leading and trailing white space are not part of the symbol name. Lines starting with # are ignored, as are lines with only white space. Some
wildcards (similar to shell file matching) are supported. The * matches zero or more characters. The ? matches one character. [abc] matches one character
which must be an 'a', 'b', or 'c'. [a-z] matches any single lower case letter from 'a' to 'z'.
-exported_symbol symbol
The specified symbol is added to the list of global symbols names that will remain as global symbols in the output file. This option can be used multiple
times. For short lists, this can be more convenient than creating a file and using -exported_symbols_list.
Original comment by zaks.a...@gmail.com
on 19 Dec 2013 at 5:28
Looks like we can just check that -Wl,_exported_symbol* is present in the
command line.
I haven't found an easy way to check for certain -Wl arguments yet, not sure if
it's ok to do plain string matching.
Original comment by ramosian.glider@gmail.com
on 20 Dec 2013 at 5:25
Can we close this now (since the flexible mapping code is gone)?
Original comment by konstant...@gmail.com
on 29 Jan 2014 at 1:17
Ok
Original comment by ramosian.glider@gmail.com
on 11 Feb 2014 at 11:03
Original issue reported on code.google.com by
zaks.a...@gmail.com
on 18 Dec 2013 at 1:15