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
Kirill Smelkov
linux
Commits
e08025ce
Commit
e08025ce
authored
Apr 04, 2003
by
Rusty Russell
Committed by
Linus Torvalds
Apr 04, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC]: Implement STT_REGISTER sparc support more cleanly.
parent
2c12e127
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
7 deletions
+40
-7
arch/sparc/kernel/module.c
arch/sparc/kernel/module.c
+20
-1
arch/sparc64/kernel/module.c
arch/sparc64/kernel/module.c
+20
-1
kernel/module.c
kernel/module.c
+0
-5
No files found.
arch/sparc/kernel/module.c
View file @
e08025ce
...
...
@@ -36,12 +36,31 @@ void module_free(struct module *mod, void *module_region)
table entries. */
}
/*
We don't need anything special.
*/
/*
Make generic code ignore STT_REGISTER dummy undefined symbols.
*/
int
module_frob_arch_sections
(
Elf_Ehdr
*
hdr
,
Elf_Shdr
*
sechdrs
,
char
*
secstrings
,
struct
module
*
mod
)
{
unsigned
int
symidx
;
Elf32_Sym
*
sym
;
const
char
*
strtab
;
int
i
;
for
(
symidx
=
0
;
sechdrs
[
symidx
].
sh_type
!=
SHT_SYMTAB
;
symidx
++
)
{
if
(
symidx
==
hdr
->
e_shnum
-
1
)
{
printk
(
"%s: no symtab found.
\n
"
,
mod
->
name
);
return
-
ENOEXEC
;
}
}
sym
=
(
Elf32_Sym
*
)
sechdrs
[
symidx
].
sh_addr
;
strtab
=
(
char
*
)
sechdrs
[
sechdrs
[
symidx
].
sh_link
].
sh_addr
;
for
(
i
=
1
;
i
<
sechdrs
[
symidx
].
sh_size
/
sizeof
(
Elf_Sym
);
i
++
)
{
if
(
sym
[
i
].
st_shndx
==
SHN_UNDEF
&&
ELF32_ST_TYPE
(
sym
[
i
].
st_info
)
==
STT_REGISTER
)
sym
[
i
].
st_shndx
=
SHN_ABS
;
}
return
0
;
}
...
...
arch/sparc64/kernel/module.c
View file @
e08025ce
...
...
@@ -143,12 +143,31 @@ void module_free(struct module *mod, void *module_region)
table entries. */
}
/*
We don't need anything special.
*/
/*
Make generic code ignore STT_REGISTER dummy undefined symbols.
*/
int
module_frob_arch_sections
(
Elf_Ehdr
*
hdr
,
Elf_Shdr
*
sechdrs
,
char
*
secstrings
,
struct
module
*
mod
)
{
unsigned
int
symidx
;
Elf64_Sym
*
sym
;
const
char
*
strtab
;
int
i
;
for
(
symidx
=
0
;
sechdrs
[
symidx
].
sh_type
!=
SHT_SYMTAB
;
symidx
++
)
{
if
(
symidx
==
hdr
->
e_shnum
-
1
)
{
printk
(
"%s: no symtab found.
\n
"
,
mod
->
name
);
return
-
ENOEXEC
;
}
}
sym
=
(
Elf64_Sym
*
)
sechdrs
[
symidx
].
sh_addr
;
strtab
=
(
char
*
)
sechdrs
[
sechdrs
[
symidx
].
sh_link
].
sh_addr
;
for
(
i
=
1
;
i
<
sechdrs
[
symidx
].
sh_size
/
sizeof
(
Elf_Sym
);
i
++
)
{
if
(
sym
[
i
].
st_shndx
==
SHN_UNDEF
&&
ELF64_ST_TYPE
(
sym
[
i
].
st_info
)
==
STT_REGISTER
)
sym
[
i
].
st_shndx
=
SHN_ABS
;
}
return
0
;
}
...
...
kernel/module.c
View file @
e08025ce
...
...
@@ -974,11 +974,6 @@ static int simplify_symbols(Elf_Shdr *sechdrs,
/* Ok if weak. */
if
(
ELF_ST_BIND
(
sym
[
i
].
st_info
)
==
STB_WEAK
)
break
;
#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64)
/* Ok if Sparc register directive. */
if
(
ELF_ST_TYPE
(
sym
[
i
].
st_info
)
==
STT_REGISTER
)
break
;
#endif
printk
(
KERN_WARNING
"%s: Unknown symbol %s
\n
"
,
mod
->
name
,
strtab
+
sym
[
i
].
st_name
);
...
...
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