ELF::Writer::Segment - Object representing the fields of one program segment in an ELF file.
version 0.000_003
The following are elf program header fields:
Type of segment: "null" (or undef), "load", "dynamic", "interp", "note", "shlib", or "phdr". Defaults to "load".
"null"
undef
"load"
"dynamic"
"interp"
"note"
"shlib"
"phdr"
Offset of this segment within the elf file
Address where this segment should be memory-mapped
Address where this segment should be loaded
Size of the segment within the elf file
Size of the segment after loaded into memory
32-bit flags. Use the accessors below to access the defined bits. Defaults to readable and executable.
Read/write the readable bit of flags
readable
Read/write the writable bit of flags
writable
Read/write the executable bit of flags.
executable
Page size, for both the file and when loaded into memory (I think?)
The payload of this segment (machine code, or etc)
Used for auto-aligning segments within the elf file. This is the number of bytes in the file which should come between "offset" and your data. Typical use of this feature is to have the first segment start at offset 0 and include the elf header, with data starting somehwere beyond it. If this is zero (or just less than the size of your elf header) then nearly a whole page will be wasted within the file as it aligns the start of the data to a page boundary.
Read-only sum of "offset" and "data_start". This is the file offset at which your data scalar (if provided) will be written to the file.
Standard Moo constructor. Pass any attributes, including the flag bit aliases.
$class->coerce($thing)
Returns $thing if it is an instance of $class, or passes $thing to the constructor otherwise.
$thing
$class
Clone this instance.
Michael Conrad <mike@nrdvana.net>
This software is copyright (c) 2016 by Michael Conrad.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install ELF::Writer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ELF::Writer
CPAN shell
perl -MCPAN -e shell install ELF::Writer
For more information on module installation, please visit the detailed CPAN module installation guide.