constify elf_backend_section_from_shdr name param
Alan Modra
amodra@bigpond.net.au
Mon Jun 3 17:52:00 GMT 2002
No backend modifies the "name" string, and probably shouldn't anyway,
since the string is most likely from inside an elf string table.
bfd/ChangeLog
* elf.c (bfd_section_from_shdr): Make "name" const.
* elf-bfd.h (elf_backend_section_from_shdr): Likewise.
* elf32-i370.c (i370_elf_section_from_shdr): Likewise.
* elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
* elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
* elf32-v850.c (v850_elf_section_from_shdr): Likewise.
* elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
* elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
* elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise.
* elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
* elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
* elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.
Applied.
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.140
diff -u -p -r1.140 elf.c
--- bfd/elf.c 31 May 2002 02:59:47 -0000 1.140
+++ bfd/elf.c 4 Jun 2002 00:07:10 -0000
@@ -1576,7 +1616,7 @@ bfd_section_from_shdr (abfd, shindex)
Elf_Internal_Shdr *hdr = elf_elfsections (abfd)[shindex];
Elf_Internal_Ehdr *ehdr = elf_elfheader (abfd);
struct elf_backend_data *bed = get_elf_backend_data (abfd);
- char *name;
+ const char *name;
name = elf_string_from_elf_strtab (abfd, hdr->sh_name);
Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.73
diff -u -p -r1.73 elf-bfd.h
--- bfd/elf-bfd.h 31 May 2002 02:59:47 -0000 1.73
+++ bfd/elf-bfd.h 4 Jun 2002 00:07:05 -0000
@@ -490,7 +490,7 @@ struct elf_backend_data
/* A function to handle unusual section types when creating BFD
sections from ELF sections. */
boolean (*elf_backend_section_from_shdr)
- PARAMS ((bfd *, Elf32_Internal_Shdr *, char *));
+ PARAMS ((bfd *, Elf32_Internal_Shdr *, const char *));
/* A function to convert machine dependent section header flags to
BFD internal section header flags. */
Index: bfd/elf32-i370.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i370.c,v
retrieving revision 1.21
diff -u -p -r1.21 elf32-i370.c
--- bfd/elf32-i370.c 7 May 2002 00:16:51 -0000 1.21
+++ bfd/elf32-i370.c 4 Jun 2002 00:07:12 -0000
@@ -319,7 +319,7 @@ static boolean i370_elf_create_dynamic_s
static boolean i370_elf_section_from_shdr PARAMS ((bfd *,
Elf32_Internal_Shdr *,
- char *));
+ const char *));
static boolean i370_elf_fake_sections PARAMS ((bfd *,
Elf32_Internal_Shdr *,
asection *));
@@ -429,7 +429,7 @@ static boolean
i370_elf_section_from_shdr (abfd, hdr, name)
bfd *abfd;
Elf32_Internal_Shdr *hdr;
- char *name;
+ const char *name;
{
asection *newsect;
flagword flags;
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.44
diff -u -p -r1.44 elf32-ppc.c
--- bfd/elf32-ppc.c 8 May 2002 05:12:54 -0000 1.44
+++ bfd/elf32-ppc.c 4 Jun 2002 00:07:14 -0000
@@ -56,7 +56,7 @@ static boolean ppc_elf_create_dynamic_se
static boolean ppc_elf_section_from_shdr PARAMS ((bfd *,
Elf32_Internal_Shdr *,
- char *));
+ const char *));
static boolean ppc_elf_fake_sections
PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *));
@@ -1490,7 +1490,7 @@ static boolean
ppc_elf_section_from_shdr (abfd, hdr, name)
bfd *abfd;
Elf32_Internal_Shdr *hdr;
- char *name;
+ const char *name;
{
asection *newsect;
flagword flags;
Index: bfd/elf32-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh64.c,v
retrieving revision 1.4
diff -u -p -r1.4 elf32-sh64.c
--- bfd/elf32-sh64.c 3 Jun 2002 01:57:09 -0000 1.4
+++ bfd/elf32-sh64.c 4 Jun 2002 00:07:17 -0000
@@ -54,7 +54,7 @@ static boolean sh64_elf_link_output_symb
PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
asection *));
static boolean sh64_backend_section_from_shdr
- PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
+ PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
static void sh64_elf_final_write_processing PARAMS ((bfd *, boolean));
static boolean sh64_bfd_elf_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *));
@@ -255,7 +255,7 @@ boolean
sh64_backend_section_from_shdr (abfd, hdr, name)
bfd *abfd;
Elf_Internal_Shdr *hdr;
- char *name;
+ const char *name;
{
flagword flags = 0;
Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.20
diff -u -p -r1.20 elf32-v850.c
--- bfd/elf32-v850.c 17 Jan 2002 13:02:40 -0000 1.20
+++ bfd/elf32-v850.c 4 Jun 2002 00:07:18 -0000
@@ -79,7 +79,7 @@ static boolean v850_elf_link_output_symb
PARAMS ((bfd *, struct bfd_link_info *, const char *,
Elf_Internal_Sym *, asection *));
static boolean v850_elf_section_from_shdr
- PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
+ PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
static boolean v850_elf_gc_sweep_hook
PARAMS ((bfd *, struct bfd_link_info *, asection *,
const Elf_Internal_Rela *));
@@ -2135,7 +2135,7 @@ static boolean
v850_elf_section_from_shdr (abfd, hdr, name)
bfd * abfd;
Elf_Internal_Shdr * hdr;
- char * name;
+ const char * name;
{
/* There ought to be a place to keep ELF backend specific flags, but
at the moment there isn't one. We just keep track of the
Index: bfd/elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.71
diff -u -p -r1.71 elf64-alpha.c
--- bfd/elf64-alpha.c 3 Jun 2002 01:57:09 -0000 1.71
+++ bfd/elf64-alpha.c 4 Jun 2002 00:07:21 -0000
@@ -73,7 +73,7 @@ static boolean elf64_alpha_mkobject
static boolean elf64_alpha_object_p
PARAMS((bfd *));
static boolean elf64_alpha_section_from_shdr
- PARAMS((bfd *, Elf64_Internal_Shdr *, char *));
+ PARAMS((bfd *, Elf64_Internal_Shdr *, const char *));
static boolean elf64_alpha_section_flags
PARAMS((flagword *, Elf64_Internal_Shdr *));
static boolean elf64_alpha_fake_sections
@@ -2353,7 +2353,7 @@ static boolean
elf64_alpha_section_from_shdr (abfd, hdr, name)
bfd *abfd;
Elf64_Internal_Shdr *hdr;
- char *name;
+ const char *name;
{
asection *newsect;
Index: bfd/elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.18
diff -u -p -r1.18 elf64-hppa.c
--- bfd/elf64-hppa.c 28 Mar 2002 03:27:45 -0000 1.18
+++ bfd/elf64-hppa.c 4 Jun 2002 00:07:23 -0000
@@ -184,7 +184,7 @@ static boolean elf64_hppa_object_p
PARAMS ((bfd *));
static boolean elf64_hppa_section_from_shdr
- PARAMS ((bfd *, Elf64_Internal_Shdr *, char *));
+ PARAMS ((bfd *, Elf64_Internal_Shdr *, const char *));
static void elf64_hppa_post_process_headers
PARAMS ((bfd *, struct bfd_link_info *));
@@ -403,7 +403,7 @@ static boolean
elf64_hppa_section_from_shdr (abfd, hdr, name)
bfd *abfd;
Elf64_Internal_Shdr *hdr;
- char *name;
+ const char *name;
{
asection *newsect;
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.48
diff -u -p -r1.48 elf64-ppc.c
--- bfd/elf64-ppc.c 3 Jun 2002 01:57:09 -0000 1.48
+++ bfd/elf64-ppc.c 4 Jun 2002 00:07:29 -0000
@@ -62,7 +62,7 @@ static boolean ppc64_elf_set_private_fla
static boolean ppc64_elf_merge_private_bfd_data
PARAMS ((bfd *, bfd *));
static boolean ppc64_elf_section_from_shdr
- PARAMS ((bfd *, Elf64_Internal_Shdr *, char *));
+ PARAMS ((bfd *, Elf64_Internal_Shdr *, const char *));
/* The name of the dynamic interpreter. This is put in the .interp
@@ -1775,7 +1775,7 @@ static boolean
ppc64_elf_section_from_shdr (abfd, hdr, name)
bfd *abfd;
Elf64_Internal_Shdr *hdr;
- char *name;
+ const char *name;
{
asection *newsect;
flagword flags;
Index: bfd/elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.48
diff -u -p -r1.48 elfxx-ia64.c
--- bfd/elfxx-ia64.c 23 May 2002 13:12:46 -0000 1.48
+++ bfd/elfxx-ia64.c 4 Jun 2002 00:07:40 -0000
@@ -174,7 +174,7 @@ static boolean elfNN_ia64_relax_section
static boolean is_unwind_section_name
PARAMS ((bfd *abfd, const char *));
static boolean elfNN_ia64_section_from_shdr
- PARAMS ((bfd *, ElfNN_Internal_Shdr *, char *));
+ PARAMS ((bfd *, ElfNN_Internal_Shdr *, const char *));
static boolean elfNN_ia64_section_flags
PARAMS ((flagword *, ElfNN_Internal_Shdr *));
static boolean elfNN_ia64_fake_sections
@@ -1047,7 +1047,7 @@ static boolean
elfNN_ia64_section_from_shdr (abfd, hdr, name)
bfd *abfd;
ElfNN_Internal_Shdr *hdr;
- char *name;
+ const char *name;
{
asection *newsect;
Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.5
diff -u -p -r1.5 elfxx-mips.c
--- bfd/elfxx-mips.c 14 May 2002 23:23:59 -0000 1.5
+++ bfd/elfxx-mips.c 4 Jun 2002 00:07:47 -0000
@@ -3351,7 +3351,7 @@ boolean
_bfd_mips_elf_section_from_shdr (abfd, hdr, name)
bfd *abfd;
Elf_Internal_Shdr *hdr;
- char *name;
+ const char *name;
{
flagword flags = 0;
Index: bfd/elfxx-mips.h
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.h,v
retrieving revision 1.1
diff -u -p -r1.1 elfxx-mips.h
--- bfd/elfxx-mips.h 4 Apr 2002 07:10:00 -0000 1.1
+++ bfd/elfxx-mips.h 4 Jun 2002 00:07:48 -0000
@@ -25,7 +25,7 @@ extern void _bfd_mips_elf_symbol_process
extern boolean _bfd_mips_elf_section_processing
PARAMS ((bfd *, Elf_Internal_Shdr *));
extern boolean _bfd_mips_elf_section_from_shdr
- PARAMS ((bfd *, Elf_Internal_Shdr *, char *));
+ PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
extern boolean _bfd_mips_elf_fake_sections
PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
extern boolean _bfd_mips_elf_section_from_bfd_section
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list