Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
8599ce68
Commit
8599ce68
authored
8 years ago
by
jdh8d
Browse files
Options
Downloads
Patches
Plain Diff
fixed elfwrite to be a bit more general for move_globals
parent
dfa549fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/elfwrite.cpp
+8
-4
8 additions, 4 deletions
src/elfwrite.cpp
with
8 additions
and
4 deletions
src/elfwrite.cpp
+
8
−
4
View file @
8599ce68
...
...
@@ -270,6 +270,7 @@ void ElfWriterImpl<T_Elf_Ehdr,T_Elf_Phdr,T_Elf_Addr,T_Elf_Shdr, T_Elf_Sym, T_Elf
}
else
{
cout
<<
"ElfWriter cannot find a place in the program for the PHDRS."
<<
endl
;
assert
(
0
);
}
...
...
@@ -444,15 +445,18 @@ template <class T_Elf_Ehdr, class T_Elf_Phdr, class T_Elf_Addr, class T_Elf_Shdr
bool
ElfWriterImpl
<
T_Elf_Ehdr
,
T_Elf_Phdr
,
T_Elf_Addr
,
T_Elf_Shdr
,
T_Elf_Sym
,
T_Elf_Rel
,
T_Elf_Rela
,
T_Elf_Dyn
>::
CreateNewPhdrs_PreAllocate
(
const
libIRDB
::
virtual_offset_t
&
min_addr
,
const
libIRDB
::
virtual_offset_t
&
max_addr
)
{
unsigned
int
phdr_size
=
page_round_up
(
DetermineMaxPhdrSize
());
auto
phdr_size
=
DetermineMaxPhdrSize
();
auto
aligned_phdr_size
=
page_round_up
(
phdr_size
);
auto
total_header_size
=
phdr_size
+
sizeof
(
T_Elf_Ehdr
);
auto
aligned_min_addr
=
page_align
(
min_addr
);
//
auto aligned_min_addr=page_align(min_addr);
if
(
total_header_size
>
aligned_min_addr
)
/* check to see if it will fit in the address space above the first pinned address */
if
(
total_header_size
>
min_addr
)
return
false
;
libIRDB
::
virtual_offset_t
new_phdr_addr
=
(
T_Elf_Addr
)
page_align
(
min_addr
)
-
total_header_size
;
return
CreateNewPhdrs_internal
(
min_addr
,
max_addr
,
phdr_size
,
true
,
sizeof
(
T_Elf_Ehdr
),
new_phdr_addr
);
return
CreateNewPhdrs_internal
(
min_addr
,
max_addr
,
aligned_
phdr_size
,
true
,
sizeof
(
T_Elf_Ehdr
),
new_phdr_addr
);
}
template
<
class
T_Elf_Ehdr
,
class
T_Elf_Phdr
,
class
T_Elf_Addr
,
class
T_Elf_Shdr
,
class
T_Elf_Sym
,
class
T_Elf_Rel
,
class
T_Elf_Rela
,
class
T_Elf_Dyn
>
...
...
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