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
a81996d7
Commit
a81996d7
authored
Jan 08, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use sysconf() instead of getpagesize().
parent
62f22dd4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
elf_module.c
dlls/dbghelp/elf_module.c
+6
-10
macho_module.c
dlls/dbghelp/macho_module.c
+2
-2
No files found.
dlls/dbghelp/elf_module.c
View file @
a81996d7
...
...
@@ -102,9 +102,7 @@ struct elf_module_info
const
char
*
elf_map_section
(
struct
image_section_map
*
ism
)
{
struct
elf_file_map
*
fmap
=
&
ism
->
fmap
->
u
.
elf
;
unsigned
long
pgsz
=
getpagesize
();
unsigned
long
ofst
,
size
;
size_t
ofst
,
size
,
pgsz
=
sysconf
(
_SC_PAGESIZE
);
assert
(
ism
->
fmap
->
modtype
==
DMT_ELF
);
if
(
ism
->
sidx
<
0
||
ism
->
sidx
>=
ism
->
fmap
->
u
.
elf
.
elfhdr
.
e_shnum
||
...
...
@@ -174,12 +172,10 @@ void elf_unmap_section(struct image_section_map* ism)
if
(
ism
->
sidx
>=
0
&&
ism
->
sidx
<
fmap
->
elfhdr
.
e_shnum
&&
!
fmap
->
target_copy
&&
fmap
->
sect
[
ism
->
sidx
].
mapped
!=
IMAGE_NO_MAP
)
{
unsigned
long
pgsz
=
getpagesize
();
unsigned
long
ofst
,
size
;
ofst
=
fmap
->
sect
[
ism
->
sidx
].
shdr
.
sh_offset
&
~
(
pgsz
-
1
);
size
=
((
fmap
->
sect
[
ism
->
sidx
].
shdr
.
sh_offset
+
fmap
->
sect
[
ism
->
sidx
].
shdr
.
sh_size
+
pgsz
-
1
)
&
~
(
pgsz
-
1
))
-
ofst
;
size_t
pgsz
=
sysconf
(
_SC_PAGESIZE
);
size_t
ofst
=
fmap
->
sect
[
ism
->
sidx
].
shdr
.
sh_offset
&
~
(
pgsz
-
1
);
size_t
size
=
((
fmap
->
sect
[
ism
->
sidx
].
shdr
.
sh_offset
+
fmap
->
sect
[
ism
->
sidx
].
shdr
.
sh_size
+
pgsz
-
1
)
&
~
(
pgsz
-
1
))
-
ofst
;
if
(
munmap
((
char
*
)
fmap
->
sect
[
ism
->
sidx
].
mapped
,
size
)
<
0
)
WARN
(
"Couldn't unmap the section
\n
"
);
fmap
->
sect
[
ism
->
sidx
].
mapped
=
IMAGE_NO_MAP
;
...
...
@@ -279,7 +275,7 @@ static BOOL elf_map_file(struct elf_map_file_data* emfd, struct image_file_map*
struct
stat
statbuf
;
int
i
;
Elf_Phdr
phdr
;
unsigned
long
tmp
,
page_mask
=
getpagesize
(
)
-
1
;
size_t
tmp
,
page_mask
=
sysconf
(
_SC_PAGESIZE
)
-
1
;
char
*
filename
;
unsigned
len
;
BOOL
ret
=
FALSE
;
...
...
dlls/dbghelp/macho_module.c
View file @
a81996d7
...
...
@@ -135,7 +135,7 @@ static void macho_calc_range(const struct macho_file_map* fmap, unsigned offset,
unsigned
*
out_aligned_end
,
unsigned
*
out_aligned_len
,
unsigned
*
out_misalign
)
{
unsigned
pagemask
=
getpagesize
(
)
-
1
;
unsigned
pagemask
=
sysconf
(
_SC_PAGESIZE
)
-
1
;
unsigned
file_offset
,
misalign
;
file_offset
=
fmap
->
arch_offset
+
offset
;
...
...
@@ -383,7 +383,7 @@ static int macho_accum_segs_range(struct macho_file_map* fmap,
const
struct
load_command
*
lc
,
void
*
user
)
{
const
struct
segment_command
*
sc
=
(
const
struct
segment_command
*
)
lc
;
unsigned
tmp
,
page_mask
=
getpagesize
(
)
-
1
;
unsigned
tmp
,
page_mask
=
sysconf
(
_SC_PAGESIZE
)
-
1
;
TRACE
(
"(%p/%d, %p, %p) before: 0x%08x - 0x%08x
\n
"
,
fmap
,
fmap
->
fd
,
lc
,
user
,
(
unsigned
)
fmap
->
segs_start
,
(
unsigned
)
fmap
->
segs_size
);
...
...
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