[Cbe-oss-dev] [PATCH 3/7] libspe2: Hide internal symbols: load

Kazunori Asayama asayama at sm.sony.co.jp
Thu Jul 19 23:22:16 EST 2007


This patch hides internal symbols in the 'load' part of libspe2.

Signed-off-by: Kazunori Asayama <asayama at sm.sony.co.jp>

---
 spebase/elf_loader.c |   10 +++++-----
 spebase/elf_loader.h |   16 +++++++---------
 spebase/image.c      |    4 ++--
 spebase/load.c       |   10 +++++-----
 4 files changed, 19 insertions(+), 21 deletions(-)

Index: b/spebase/elf_loader.c
===================================================================
--- a/spebase/elf_loader.c	2007-07-19 20:40:25.000000000 +0900
+++ b/spebase/elf_loader.c	2007-07-19 20:44:52.000000000 +0900
@@ -58,7 +58,7 @@ static const unsigned char expected[EI_P
 	[EI_ABIVERSION] = 0
 };
 
-int
+static int
 check_spe_elf(Elf32_Ehdr *ehdr)
 {
 	/* Validate ELF */
@@ -96,7 +96,7 @@ check_spe_elf(Elf32_Ehdr *ehdr)
  * verifies integrity of an SPE image
  */
 int  
-verify_spe_elf_image(spe_program_handle_t *handle)
+_base_spe_verify_spe_elf_image(spe_program_handle_t *handle)
 {
 	Elf32_Ehdr *ehdr;
 	void *elf_start;
@@ -108,7 +108,7 @@ verify_spe_elf_image(spe_program_handle_
 }
 
 int
-spe_parse_isolated_elf(spe_program_handle_t *handle,
+_base_spe_parse_isolated_elf(spe_program_handle_t *handle,
 		uint64_t *addr, uint32_t *size)
 {
 	Elf32_Ehdr *ehdr = (Elf32_Ehdr *)handle->elf_image;
@@ -198,7 +198,7 @@ copy_to_ld_buffer(spe_program_handle_t *
 }
 
 int
-load_spe_elf (spe_program_handle_t *handle, void *ld_buffer, struct spe_ld_info *ld_info)
+_base_spe_load_spe_elf (spe_program_handle_t *handle, void *ld_buffer, struct spe_ld_info *ld_info)
 {
 	Elf32_Ehdr *ehdr;
 	Elf32_Phdr *phdr;
@@ -351,7 +351,7 @@ toe_check_syms(Elf32_Ehdr *ehdr, Elf32_S
 	return ret;
 }
 
-int toe_ear (spe_program_handle_t *speh)
+int _base_spe_toe_ear (spe_program_handle_t *speh)
 {
 	Elf32_Ehdr *ehdr;
 	Elf32_Shdr *shdr, *sh;
Index: b/spebase/elf_loader.h
===================================================================
--- a/spebase/elf_loader.h	2007-07-19 20:40:25.000000000 +0900
+++ b/spebase/elf_loader.h	2007-07-19 20:45:51.000000000 +0900
@@ -39,15 +39,13 @@ struct spe_ld_info
 /*
  * Global API : */
 
-int check_spe_elf(Elf32_Ehdr *ehdr);
+int _base_spe_verify_spe_elf_image(spe_program_handle_t *handle);
 
-int verify_spe_elf_image(spe_program_handle_t *handle);
+int _base_spe_load_spe_elf (spe_program_handle_t *handle, void *ld_buffer,
+			    struct spe_ld_info *ld_info);
 
-int load_spe_elf (spe_program_handle_t *handle, void *ld_buffer,
-		  struct spe_ld_info *ld_info);
-		  
-int spe_parse_isolated_elf(spe_program_handle_t *handle,
-		uint64_t *addr, uint32_t *size);
-		
-int toe_ear (spe_program_handle_t *speh);
+int _base_spe_parse_isolated_elf(spe_program_handle_t *handle,
+				 uint64_t *addr, uint32_t *size);
+
+int _base_spe_toe_ear (spe_program_handle_t *speh);
 		  
Index: b/spebase/image.c
===================================================================
--- a/spebase/image.c	2007-07-19 20:40:25.000000000 +0900
+++ b/spebase/image.c	2007-07-19 20:44:52.000000000 +0900
@@ -74,10 +74,10 @@ spe_program_handle_t *_base_spe_image_op
 		goto ret_err;
 
 	/*Verify that this is a valid SPE ELF object*/
-	if((verify_spe_elf_image((spe_program_handle_t *)ret)))
+	if((_base_spe_verify_spe_elf_image((spe_program_handle_t *)ret)))
 		goto ret_err;
 
-	if (toe_ear(&ret->speh))
+	if (_base_spe_toe_ear(&ret->speh))
 		goto ret_err;
 
 	/* ok */
Index: b/spebase/load.c
===================================================================
--- a/spebase/load.c	2007-07-19 20:40:25.000000000 +0900
+++ b/spebase/load.c	2007-07-19 20:46:35.000000000 +0900
@@ -61,7 +61,7 @@ static int spe_start_isolated_app(struct
 	uint64_t addr;
 	uint32_t size, addr_h, addr_l;
 
-	if (spe_parse_isolated_elf(handle, &addr, &size)) {
+	if (_base_spe_parse_isolated_elf(handle, &addr, &size)) {
 		DEBUG_PRINTF("%s: invalid isolated image\n", __FUNCTION__);
 		errno = ENOEXEC;
 		return -errno;
@@ -121,7 +121,7 @@ int _base_spe_emulated_loader_present(vo
 	if (!loader)
 		return 0;
 
-	return !verify_spe_elf_image(loader);
+	return !_base_spe_verify_spe_elf_image(loader);
 }
 
 /**
@@ -149,7 +149,7 @@ static int spe_start_emulated_isolated_a
 	if (!loader)
 		return -1;
 
-	rc = load_spe_elf(loader, spe->base_private->mem_mmap_base, ld_info);
+	rc = _base_spe_load_spe_elf(loader, spe->base_private->mem_mmap_base, ld_info);
 	if (rc != 0) {
 		DEBUG_PRINTF("%s: No loader available\n", __FUNCTION__);
 		return rc;
@@ -170,8 +170,8 @@ int _base_spe_program_load(spe_context_p
 		rc = spe_start_emulated_isolated_app(spe, program, &ld_info);
 
 	} else {
-		rc = load_spe_elf(program, spe->base_private->mem_mmap_base,
-				&ld_info);
+		rc = _base_spe_load_spe_elf(program, spe->base_private->mem_mmap_base,
+					    &ld_info);
 	}
 
 	if (rc != 0) {



More information about the cbe-oss-dev mailing list