Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
78845911
Commit
78845911
authored
Mar 31, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use local elf_header declaration.
Based on glibc. Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
11ea2315
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
elf_module.c
dlls/dbghelp/elf_module.c
+19
-3
image_private.h
dlls/dbghelp/image_private.h
+19
-1
No files found.
dlls/dbghelp/elf_module.c
View file @
78845911
...
@@ -359,7 +359,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
...
@@ -359,7 +359,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
unsigned
int
i
;
unsigned
int
i
;
size_t
tmp
,
page_mask
=
sysinfo
.
dwPageSize
-
1
;
size_t
tmp
,
page_mask
=
sysinfo
.
dwPageSize
-
1
;
WCHAR
*
dos_path
;
WCHAR
*
dos_path
;
unsigned
char
e_ident
[
EI_NIDENT
];
unsigned
char
e_ident
[
ARRAY_SIZE
(
fmap
->
u
.
elf
.
elfhdr
.
e_ident
)
];
elf_reset_file_map
(
fmap
);
elf_reset_file_map
(
fmap
);
...
@@ -394,12 +394,28 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
...
@@ -394,12 +394,28 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
if
(
fmap
->
addr_size
==
32
)
if
(
fmap
->
addr_size
==
32
)
{
{
Elf32_Ehdr
elfhdr32
;
struct
{
UINT8
e_ident
[
16
];
/* Magic number and other info */
UINT16
e_type
;
/* Object file type */
UINT16
e_machine
;
/* Architecture */
UINT32
e_version
;
/* Object file version */
UINT32
e_entry
;
/* Entry point virtual address */
UINT32
e_phoff
;
/* Program header table file offset */
UINT32
e_shoff
;
/* Section header table file offset */
UINT32
e_flags
;
/* Processor-specific flags */
UINT16
e_ehsize
;
/* ELF header size in bytes */
UINT16
e_phentsize
;
/* Program header table entry size */
UINT16
e_phnum
;
/* Program header table entry count */
UINT16
e_shentsize
;
/* Section header table entry size */
UINT16
e_shnum
;
/* Section header table entry count */
UINT16
e_shstrndx
;
/* Section header string table index */
}
elfhdr32
;
if
(
!
elf_map_file_read
(
fmap
,
emfd
,
&
elfhdr32
,
sizeof
(
elfhdr32
),
0
))
if
(
!
elf_map_file_read
(
fmap
,
emfd
,
&
elfhdr32
,
sizeof
(
elfhdr32
),
0
))
return
FALSE
;
return
FALSE
;
memcpy
(
fmap
->
u
.
elf
.
elfhdr
.
e_ident
,
elfhdr32
.
e_ident
,
EI_NIDENT
);
memcpy
(
fmap
->
u
.
elf
.
elfhdr
.
e_ident
,
elfhdr32
.
e_ident
,
sizeof
(
e_ident
)
);
fmap
->
u
.
elf
.
elfhdr
.
e_type
=
elfhdr32
.
e_type
;
fmap
->
u
.
elf
.
elfhdr
.
e_type
=
elfhdr32
.
e_type
;
fmap
->
u
.
elf
.
elfhdr
.
e_machine
=
elfhdr32
.
e_machine
;
fmap
->
u
.
elf
.
elfhdr
.
e_machine
=
elfhdr32
.
e_machine
;
fmap
->
u
.
elf
.
elfhdr
.
e_version
=
elfhdr32
.
e_version
;
fmap
->
u
.
elf
.
elfhdr
.
e_version
=
elfhdr32
.
e_version
;
...
...
dlls/dbghelp/image_private.h
View file @
78845911
...
@@ -48,6 +48,24 @@
...
@@ -48,6 +48,24 @@
#define IMAGE_NO_MAP ((void*)-1)
#define IMAGE_NO_MAP ((void*)-1)
struct
elf_header
{
UINT8
e_ident
[
16
];
/* Magic number and other info */
UINT16
e_type
;
/* Object file type */
UINT16
e_machine
;
/* Architecture */
UINT32
e_version
;
/* Object file version */
UINT64
e_entry
;
/* Entry point virtual address */
UINT64
e_phoff
;
/* Program header table file offset */
UINT64
e_shoff
;
/* Section header table file offset */
UINT32
e_flags
;
/* Processor-specific flags */
UINT16
e_ehsize
;
/* ELF header size in bytes */
UINT16
e_phentsize
;
/* Program header table entry size */
UINT16
e_phnum
;
/* Program header table entry count */
UINT16
e_shentsize
;
/* Section header table entry size */
UINT16
e_shnum
;
/* Section header table entry count */
UINT16
e_shstrndx
;
/* Section header string table index */
};
/* structure holding information while handling an ELF image
/* structure holding information while handling an ELF image
* allows one by one section mapping for memory savings
* allows one by one section mapping for memory savings
*/
*/
...
@@ -66,8 +84,8 @@ struct image_file_map
...
@@ -66,8 +84,8 @@ struct image_file_map
HANDLE
handle
;
HANDLE
handle
;
const
char
*
shstrtab
;
const
char
*
shstrtab
;
char
*
target_copy
;
char
*
target_copy
;
struct
elf_header
elfhdr
;
#ifdef __ELF__
#ifdef __ELF__
Elf64_Ehdr
elfhdr
;
struct
struct
{
{
Elf64_Shdr
shdr
;
Elf64_Shdr
shdr
;
...
...
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