Skip to content

Commit d4b3e39

Browse files
committed
Convert contents() to read()
1 parent 5ec108c commit d4b3e39

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

src/Abstract/Section.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export Sections,
66

77
# Export Section API
88
export Section,
9-
deref, contents, section_name, section_size, section_offset,
9+
deref, section_name, section_size, section_offset,
1010
section_address
1111

1212
# Export Datatypes
@@ -136,7 +136,7 @@ subclasses must implement marked in emphasis:
136136
- deref()
137137
138138
### IO-like operations:
139-
- contents()
139+
- read()
140140
141141
### Format-specific properties:
142142
- *section_name()*
@@ -152,18 +152,17 @@ abstract type Section{H<:ObjectHandle} end
152152
deref(section::Section) = section
153153

154154
"""
155-
contents(oh::ObjectHandle, section::Section)
155+
read(oh::ObjectHandle, section::Section)
156156
157157
Read the contents of the section referred to by `section` from the given
158158
`ObjectHandle`, returning a `Vector{UInt8}`.
159159
"""
160-
function contents(oh::H, section::Section{H}) where {H<:ObjectHandle}
160+
function read(oh::H, section::Section{H}) where {H<:ObjectHandle}
161161
# Seek to the section's location, then read it in!
162162
seek(oh, section_offset(section))
163-
return read(oh, size(section))
163+
return read(oh, section_size(section))
164164
end
165165

166-
167166
"""
168167
section_name(section::Section)
169168

src/COFF/COFF.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ObjectFile: DynamicLink, DynamicLinks, RPath, ObjectHandle, Section, Sect
1313
format_string, section_header_offset, section_header_size, section_header_type,
1414
segment_header_offset, segment_header_size, segment_header_type, startaddr,
1515
symtab_entry_offset, symtab_entry_size, symtab_entry_type, find_libraries,
16-
findfirst, deref, contents, section_name, section_size,
16+
findfirst, deref, section_name, section_size,
1717
section_offset, section_address, section_number, segment_name, segment_offset,
1818
segment_file_size, segment_memory_size, segment_address, strtab_lookup,
1919
symbol_name, symbol_value, isundef, isglobal, islocal, isweak, symbol_number

src/ELF/ELF.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ObjectFile: DynamicLink, DynamicLinks, RPath, ObjectHandle, Section, Sect
1313
format_string, section_header_offset, section_header_size, section_header_type,
1414
segment_header_offset, segment_header_size, segment_header_type, startaddr,
1515
symtab_entry_offset, symtab_entry_size, symtab_entry_type, find_libraries,
16-
findfirst, deref, contents, section_name, section_size,
16+
findfirst, deref, section_name, section_size,
1717
section_offset, section_address, section_number, segment_name, segment_offset,
1818
segment_file_size, segment_memory_size, segment_address, strtab_lookup,
1919
symbol_name, symbol_value, isundef, isglobal, islocal, isweak, symbol_number
@@ -35,4 +35,4 @@ include("ELFDynamicLink.jl")
3535
#include("ELFRelocation.jl")
3636
#include("ELFDebug.jl")
3737

38-
end # module ELF
38+
end # module ELF

src/MachO/MachO.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ObjectFile: DynamicLink, DynamicLinks, RPath, ObjectHandle, Section, Sect
1313
format_string, section_header_offset, section_header_size, section_header_type,
1414
segment_header_offset, segment_header_size, segment_header_type, startaddr,
1515
symtab_entry_offset, symtab_entry_size, symtab_entry_type, find_libraries,
16-
findfirst, deref, contents, section_name, section_size,
16+
findfirst, deref, section_name, section_size,
1717
section_offset, section_address, section_number, segment_name, segment_offset,
1818
segment_file_size, segment_memory_size, segment_address, strtab_lookup,
1919
symbol_name, symbol_value, isundef, isglobal, islocal, isweak, symbol_number
@@ -35,4 +35,4 @@ include("MachOSymbol.jl")
3535
include("MachOFat.jl")
3636

3737

38-
end # module MachO
38+
end # module MachO

0 commit comments

Comments
 (0)