diff options
author | Elliott Hughes <enh@google.com> | 2024-04-10 21:52:10 +0000 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2024-04-10 21:52:10 +0000 |
commit | 396868c7476fa4c30fd7929bd5fd5f46b19ba48f (patch) | |
tree | cda538b1fe8aed8d8a52e632dae8a9ffb43b9aca | |
parent | 117478dd4ea3225ef897bcc3b4afb5e709d9c467 (diff) | |
download | bionic-396868c7476fa4c30fd7929bd5fd5f46b19ba48f.tar.gz |
[[nodiscard]] the various ElfReader functions.
These are either only useful for their side-effects, or things you
really need to check.
Change-Id: I8e231185eb7fc8656fd3cb916169661833b525bf
-rw-r--r-- | linker/linker_phdr.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/linker/linker_phdr.h b/linker/linker_phdr.h index 4deed3349..61242eb4c 100644 --- a/linker/linker_phdr.h +++ b/linker/linker_phdr.h @@ -43,8 +43,8 @@ class ElfReader { public: ElfReader(); - bool Read(const char* name, int fd, off64_t file_offset, off64_t file_size); - bool Load(address_space_params* address_space); + [[nodiscard]] bool Read(const char* name, int fd, off64_t file_offset, off64_t file_size); + [[nodiscard]] bool Load(address_space_params* address_space); const char* name() const { return name_.c_str(); } size_t phdr_count() const { return phdr_num_; } @@ -61,18 +61,18 @@ class ElfReader { bool should_pad_segments() const { return should_pad_segments_; } private: - bool ReadElfHeader(); - bool VerifyElfHeader(); - bool ReadProgramHeaders(); - bool ReadSectionHeaders(); - bool ReadDynamicSection(); - bool ReadPadSegmentNote(); - bool ReserveAddressSpace(address_space_params* address_space); - bool LoadSegments(); - bool FindPhdr(); - bool FindGnuPropertySection(); - bool CheckPhdr(ElfW(Addr)); - bool CheckFileRange(ElfW(Addr) offset, size_t size, size_t alignment); + [[nodiscard]] bool ReadElfHeader(); + [[nodiscard]] bool VerifyElfHeader(); + [[nodiscard]] bool ReadProgramHeaders(); + [[nodiscard]] bool ReadSectionHeaders(); + [[nodiscard]] bool ReadDynamicSection(); + [[nodiscard]] bool ReadPadSegmentNote(); + [[nodiscard]] bool ReserveAddressSpace(address_space_params* address_space); + [[nodiscard]] bool LoadSegments(); + [[nodiscard]] bool FindPhdr(); + [[nodiscard]] bool FindGnuPropertySection(); + [[nodiscard]] bool CheckPhdr(ElfW(Addr)); + [[nodiscard]] bool CheckFileRange(ElfW(Addr) offset, size_t size, size_t alignment); bool did_read_; bool did_load_; |