aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-04-10 23:59:15 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-10 23:59:15 +0000
commitd73b7b3e2424a67ee2753dad820e2ad375db20d1 (patch)
treecda538b1fe8aed8d8a52e632dae8a9ffb43b9aca
parent117478dd4ea3225ef897bcc3b4afb5e709d9c467 (diff)
parent396868c7476fa4c30fd7929bd5fd5f46b19ba48f (diff)
downloadbionic-d73b7b3e2424a67ee2753dad820e2ad375db20d1.tar.gz
Merge "[[nodiscard]] the various ElfReader functions." into main
-rw-r--r--linker/linker_phdr.h28
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_;