Skip to content

Add what to verify section#85

Merged
DeanoBurrito merged 13 commits intomasterfrom
addition_to_elf_part
Mar 25, 2024
Merged

Add what to verify section#85
DeanoBurrito merged 13 commits intomasterfrom
addition_to_elf_part

Conversation

@dreamos82
Copy link
Copy Markdown
Member

No description provided.

Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated
Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated
Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated
Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated
Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated

* The first thing we want to check is the Magic number, this is the `ELFMAG` part. It is expected to be the following values: `0x7f, 'E', 'L', 'F'`. Bytes 0 to 3.
* We need to check that the file class match with the one we are supporting. There are two possible classes: 64 and 32. Thi is byte 4
* The data field indicates the bit numbering convetion, again this depends on the architecture used. It can be three values: None (0), LSB (1) and MSB (2). For example x86_64 architecture value is 1. This field is in the byte 5.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bit numbering convention is usually referred to as endianness (which end of the number comes first). X86_64 is little endian, so we want LSB (1).

* The version field, byte 6, to be a valid elf it has to be set to 1 (EVCURRENT).
* The OS Abi and Abi version they identify the operating system together with the ABI to which the object is targeted and the version of the ABI to which the object is targeted, for now we can ignore them, the should be 0.

Then from the other fields that needs validation (that area not in the `e_ident` field) are:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs -> need

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated
Comment thread 99_Appendices/E_Cross_Compilers.md Outdated
Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated
* The version field, byte 6, to be a valid elf it has to be set to 1 (EVCURRENT).
* The OS Abi and Abi version they identify the operating system together with the ABI to which the object is targeted and the version of the ABI to which the object is targeted, for now we can ignore them, the should be 0.

Then from the other fields that needs validation (that area not in the `e_ident` field) are:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated
Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated
Comment thread 09_Loading_Elf/02_Loading_And_Running.md Outdated
@DeanoBurrito DeanoBurrito merged commit bb2cb22 into master Mar 25, 2024
@dreamos82 dreamos82 deleted the addition_to_elf_part branch September 1, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants