1 // Copyright 2018 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_DEBUG_ELF_READER_LINUX_H_ 6 #define BASE_DEBUG_ELF_READER_LINUX_H_ 7 8 #include <string> 9 10 #include "base/base_export.h" 11 #include "base/optional.h" 12 13 namespace base { 14 namespace debug { 15 16 // Returns the ELF section .note.gnu.build-id from the ELF file mapped at 17 // |elf_base|, if present. The caller must ensure that the file is fully mapped 18 // in memory. 19 Optional<std::string> BASE_EXPORT ReadElfBuildId(const void* elf_base); 20 21 // Returns the library name from the ELF file mapped at |elf_base|, if present. 22 // The caller must ensure that the file is fully mapped in memory. 23 Optional<std::string> BASE_EXPORT ReadElfLibraryName(const void* elf_base); 24 25 } // namespace debug 26 } // namespace base 27 28 #endif // BASE_DEBUG_ELF_READER_LINUX_H_ 29