Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 8232cb9

Browse files
enh-googleGerrit Code Review
authored andcommitted
Merge "linker: don't abbreviate "offset"." into main
2 parents 42b1a45 + bcff7cc commit 8232cb9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

linker/linker_phdr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,19 +345,19 @@ bool ElfReader::CheckFileRange(ElfW(Addr) offset, size_t size, size_t alignment)
345345
((offset % alignment) == 0);
346346
}
347347

348-
void* ElfReader::MapData(MappedFileFragment* fragment, off64_t offs, off64_t size) {
348+
void* ElfReader::MapData(MappedFileFragment* fragment, off64_t offset, off64_t size) {
349349
off64_t end;
350-
CHECK(safe_add(&end, offs, size));
350+
CHECK(safe_add(&end, offset, size));
351351

352352
// If the data is already mapped just return it
353353
if (static_cast<off64_t>(file_fragment_.size()) >= end) {
354-
return static_cast<char*>(file_fragment_.data()) + offs;
354+
return static_cast<char*>(file_fragment_.data()) + offset;
355355
}
356356
// Use the passed-in fragment if area is not mapped. We can't remap the original fragment
357357
// because that invalidates all previous pointers if the file is remapped to a different
358358
// virtual address. A local variable can't be used in place of the passed-in fragment because
359359
// the area would be unmapped as soon as the local object goes out of scope.
360-
if (fragment->Map(fd_, file_offset_, offs, size)) {
360+
if (fragment->Map(fd_, file_offset_, offset, size)) {
361361
return fragment->data();
362362
}
363363
return nullptr;

linker/linker_phdr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ElfReader {
7373
[[nodiscard]] bool FindGnuPropertySection();
7474
[[nodiscard]] bool CheckPhdr(ElfW(Addr));
7575
[[nodiscard]] bool CheckFileRange(ElfW(Addr) offset, size_t size, size_t alignment);
76-
[[nodiscard]] void* MapData(MappedFileFragment* fragment, off64_t offs, off64_t size);
76+
[[nodiscard]] void* MapData(MappedFileFragment* fragment, off64_t offset, off64_t size);
7777

7878
bool did_read_;
7979
bool did_load_;

0 commit comments

Comments
 (0)