Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3f6f586d
Commit
3f6f586d
authored
Dec 06, 2002
by
Paul Mackerras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: in loading modules, make sure PLT start address is aligned.
parent
356f833b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
arch/ppc/kernel/module.c
arch/ppc/kernel/module.c
+9
-5
No files found.
arch/ppc/kernel/module.c
View file @
3f6f586d
...
...
@@ -21,6 +21,7 @@
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/cache.h>
#if 0
#define DEBUGP printk
...
...
@@ -105,8 +106,9 @@ long module_core_size(const Elf32_Ehdr *hdr,
const
char
*
secstrings
,
struct
module
*
module
)
{
module
->
arch
.
core_plt_offset
=
module
->
core_size
;
return
module
->
core_size
+
get_plt_size
(
hdr
,
sechdrs
,
secstrings
,
0
);
module
->
arch
.
core_plt_offset
=
ALIGN
(
module
->
core_size
,
4
);
return
module
->
arch
.
core_plt_offset
+
get_plt_size
(
hdr
,
sechdrs
,
secstrings
,
0
);
}
long
module_init_size
(
const
Elf32_Ehdr
*
hdr
,
...
...
@@ -114,8 +116,9 @@ long module_init_size(const Elf32_Ehdr *hdr,
const
char
*
secstrings
,
struct
module
*
module
)
{
module
->
arch
.
init_plt_offset
=
module
->
init_size
;
return
module
->
init_size
+
get_plt_size
(
hdr
,
sechdrs
,
secstrings
,
1
);
module
->
arch
.
init_plt_offset
=
ALIGN
(
module
->
init_size
,
4
);
return
module
->
arch
.
init_plt_offset
+
get_plt_size
(
hdr
,
sechdrs
,
secstrings
,
1
);
}
int
apply_relocate
(
Elf32_Shdr
*
sechdrs
,
...
...
@@ -142,7 +145,7 @@ static uint32_t do_plt_call(void *location, Elf32_Addr val, struct module *mod)
{
struct
ppc_plt_entry
*
entry
;
DEBUGP
(
"Doing plt for
%u
\n
"
,
(
unsigned
int
)
location
);
DEBUGP
(
"Doing plt for
call to 0x%x at 0x%x
\n
"
,
val
,
(
unsigned
int
)
location
);
/* Init, or core PLT? */
if
(
location
>=
mod
->
module_core
&&
location
<
mod
->
module_core
+
mod
->
arch
.
core_plt_offset
)
...
...
@@ -162,6 +165,7 @@ static uint32_t do_plt_call(void *location, Elf32_Addr val, struct module *mod)
entry
->
jump
[
2
]
=
0x7d6903a6
;
/* mtctr r11 */
entry
->
jump
[
3
]
=
0x4e800420
;
/* bctr */
DEBUGP
(
"Initialized plt for 0x%x at %p
\n
"
,
val
,
entry
);
return
(
uint32_t
)
entry
;
}
...
...
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