Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
40059017
Commit
40059017
authored
May 31, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Translate the 32-bit ELF section header to the 64-bit one.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
799e0bfa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
6 deletions
+33
-6
elf_module.c
dlls/dbghelp/elf_module.c
+32
-3
image_private.h
dlls/dbghelp/image_private.h
+1
-3
No files found.
dlls/dbghelp/elf_module.c
View file @
40059017
...
...
@@ -292,6 +292,36 @@ static BOOL elf_map_file_read(struct image_file_map* fmap, struct elf_map_file_d
}
}
static
BOOL
elf_map_shdr
(
struct
elf_map_file_data
*
emfd
,
struct
image_file_map
*
fmap
,
unsigned
int
i
)
{
if
(
fmap
->
addr_size
==
32
)
{
Elf32_Shdr
shdr32
;
if
(
!
elf_map_file_read
(
fmap
,
emfd
,
&
shdr32
,
sizeof
(
shdr32
),
fmap
->
u
.
elf
.
elfhdr
.
e_shoff
+
i
*
sizeof
(
Elf32_Shdr
)))
return
FALSE
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_name
=
shdr32
.
sh_name
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_type
=
shdr32
.
sh_type
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_flags
=
shdr32
.
sh_flags
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_addr
=
shdr32
.
sh_addr
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_offset
=
shdr32
.
sh_offset
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_size
=
shdr32
.
sh_size
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_link
=
shdr32
.
sh_link
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_info
=
shdr32
.
sh_info
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_addralign
=
shdr32
.
sh_addralign
;
fmap
->
u
.
elf
.
sect
[
i
].
shdr
.
sh_entsize
=
shdr32
.
sh_entsize
;
}
else
{
if
(
!
elf_map_file_read
(
fmap
,
emfd
,
&
fmap
->
u
.
elf
.
sect
[
i
].
shdr
,
sizeof
(
fmap
->
u
.
elf
.
sect
[
i
].
shdr
),
fmap
->
u
.
elf
.
elfhdr
.
e_shoff
+
i
*
sizeof
(
Elf64_Shdr
)))
return
FALSE
;
}
return
TRUE
;
}
/******************************************************************
* elf_map_file
*
...
...
@@ -385,8 +415,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
for
(
i
=
0
;
i
<
fmap
->
u
.
elf
.
elfhdr
.
e_shnum
;
i
++
)
{
if
(
!
elf_map_file_read
(
fmap
,
emfd
,
&
fmap
->
u
.
elf
.
sect
[
i
].
shdr
,
sizeof
(
fmap
->
u
.
elf
.
sect
[
i
].
shdr
),
fmap
->
u
.
elf
.
elfhdr
.
e_shoff
+
i
*
sizeof
(
fmap
->
u
.
elf
.
sect
[
i
].
shdr
)))
if
(
!
elf_map_shdr
(
emfd
,
fmap
,
i
))
{
HeapFree
(
GetProcessHeap
(),
0
,
fmap
->
u
.
elf
.
sect
);
fmap
->
u
.
elf
.
sect
=
NULL
;
...
...
@@ -1225,7 +1254,7 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename,
if
(
elf_find_section
(
fmap
,
".dynamic"
,
SHT_DYNAMIC
,
&
ism
))
{
Elf_Dyn
dyn
;
char
*
ptr
=
(
char
*
)
fmap
->
u
.
elf
.
sect
[
ism
.
sidx
].
shdr
.
sh_addr
;
char
*
ptr
=
(
char
*
)
(
ULONG_PTR
)
fmap
->
u
.
elf
.
sect
[
ism
.
sidx
].
shdr
.
sh_addr
;
unsigned
long
len
;
if
(
load_offset
)
ptr
+=
load_offset
-
fmap
->
u
.
elf
.
elf_start
;
...
...
dlls/dbghelp/image_private.h
View file @
40059017
...
...
@@ -59,13 +59,11 @@ typedef struct section macho_section;
#ifdef __ELF__
#ifdef _WIN64
#define Elf_Shdr Elf64_Shdr
#define Elf_Phdr Elf64_Phdr
#define Elf_Dyn Elf64_Dyn
#define Elf_Sym Elf64_Sym
#define Elf_auxv_t Elf64_auxv_t
#else
#define Elf_Shdr Elf32_Shdr
#define Elf_Phdr Elf32_Phdr
#define Elf_Dyn Elf32_Dyn
#define Elf_Sym Elf32_Sym
...
...
@@ -98,7 +96,7 @@ struct image_file_map
Elf64_Ehdr
elfhdr
;
struct
{
Elf
_Shdr
shdr
;
Elf
64_Shdr
shdr
;
const
char
*
mapped
;
}
*
sect
;
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment