Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
1c4f9e82
There was an error fetching the commit references. Please try again later.
Commit
1c4f9e82
authored
7 years ago
by
bunnei
Browse files
Options
Downloads
Patches
Plain Diff
elf: Check if machine is ARM.
parent
f2f39102
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/loader/elf.cpp
+9
-2
9 additions, 2 deletions
src/core/loader/elf.cpp
with
9 additions
and
2 deletions
src/core/loader/elf.cpp
+
9
−
2
View file @
1c4f9e82
...
@@ -364,12 +364,19 @@ SectionID ElfReader::GetSectionByName(const char* name, int firstSection) const
...
@@ -364,12 +364,19 @@ SectionID ElfReader::GetSectionByName(const char* name, int firstSection) const
namespace
Loader
{
namespace
Loader
{
FileType
AppLoader_ELF
::
IdentifyType
(
FileUtil
::
IOFile
&
file
)
{
FileType
AppLoader_ELF
::
IdentifyType
(
FileUtil
::
IOFile
&
file
)
{
u32
magic
;
static
constexpr
u16
ELF_MACHINE_ARM
{
0x28
};
u32
magic
=
0
;
file
.
Seek
(
0
,
SEEK_SET
);
file
.
Seek
(
0
,
SEEK_SET
);
if
(
1
!=
file
.
ReadArray
<
u32
>
(
&
magic
,
1
))
if
(
1
!=
file
.
ReadArray
<
u32
>
(
&
magic
,
1
))
return
FileType
::
Error
;
return
FileType
::
Error
;
if
(
MakeMagic
(
'\x7f'
,
'E'
,
'L'
,
'F'
)
==
magic
)
u16
machine
=
0
;
file
.
Seek
(
18
,
SEEK_SET
);
if
(
1
!=
file
.
ReadArray
<
u16
>
(
&
machine
,
1
))
return
FileType
::
Error
;
if
(
MakeMagic
(
'\x7f'
,
'E'
,
'L'
,
'F'
)
==
magic
&&
ELF_MACHINE_ARM
==
machine
)
return
FileType
::
ELF
;
return
FileType
::
ELF
;
return
FileType
::
Error
;
return
FileType
::
Error
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment