Page MenuHomePhabricator

[Sanitizers] Introduce GET_LINK_MAP_BY_DLOPEN_HANDLE() macro
ClosedPublic

Authored by kutuzov.viktor.84 on Jan 28 2015, 11:30 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

kutuzov.viktor.84 retitled this revision from to [Sanitizers] Fix ForEachMappedRegion() to work on FreeBSD.
kutuzov.viktor.84 updated this object.
kutuzov.viktor.84 edited the test plan for this revision. (Show Details)
kutuzov.viktor.84 added a subscriber: Unknown Object (MLST).
samsonov added inline comments.Jan 28 2015, 2:48 PM
lib/sanitizer_common/sanitizer_linux.cc
808 ↗(On Diff #18910)

Looks like you need a named constant for 544 (maybe, in sanitizer_platform_limits_posix.h). Is it possible to calculate it in sanitizer_platform_limits_posix.cc by using offsetof() ?

kutuzov.viktor.84 retitled this revision from [Sanitizers] Fix ForEachMappedRegion() to work on FreeBSD to [Sanitizers] Introduce GET_LINK_MAP_BY_DLOPEN_HANDLE() macro.

Reworked. Thanks.

Is it possible to calculate it in sanitizer_platform_limits_posix.cc by using offsetof() ?

The Obj_Entry structure is defined in rtld's internals and have a lot of members so it doesn't seem reasonable to replicate its definition in sanitizers sources.

lib/sanitizer_common/sanitizer_common_interceptors.inc
88 ↗(On Diff #18946)

Should these macros expand into do {} while(0)?

eugenis accepted this revision.Jan 29 2015, 9:06 AM
eugenis edited edge metadata.

Looks ok.

lib/sanitizer_common/sanitizer_common_interceptors.inc
88 ↗(On Diff #18946)

They could.

This revision is now accepted and ready to land.Jan 29 2015, 9:06 AM
This revision was automatically updated to reflect the committed changes.