/* Renesas / SuperH specific support for Symbian 32-bit ELF files
- Copyright 2004
+ Copyright 2004, 2005
Free Software Foundation, Inc.
Contributed by Red Hat
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
/* Stop elf32-sh.c from defining any target vectors. */
#define SH_TARGET_ALREADY_DEFINED
+#define sh_find_elf_flags sh_symbian_find_elf_flags
+#define sh_elf_get_flags_from_mach sh_symbian_elf_get_flags_from_mach
#include "elf32-sh.c"
typedef struct symbol_rename
{
struct symbol_rename * next;
- bfd_byte * current_name;
- bfd_byte * new_name;
+ char * current_name;
+ char * new_name;
struct elf_link_hash_entry * current_hash;
unsigned long new_symndx;
}
static bfd_boolean
sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd,
- bfd_byte * current_name, bfd_byte * new_name)
+ char * current_name, char * new_name)
{
struct elf_link_hash_entry * new_hash;
symbol_rename * node;
return TRUE;
bfd_set_error (bfd_error_invalid_operation);
- _bfd_error_handler (_("%s: IMPORT AS directive for %s conceals previous IMPORT AS"),
- bfd_archive_filename (abfd), current_name);
+ _bfd_error_handler (_("%B: IMPORT AS directive for %s conceals previous IMPORT AS"),
+ abfd, current_name);
return FALSE;
}
static bfd_boolean
-sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, bfd_byte * name)
+sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, char * name)
{
if (DEBUG)
fprintf (stderr, "IMPORT '%s'\n", name);
}
static bfd_boolean
-sh_symbian_export (bfd * abfd ATTRIBUTE_UNUSED, bfd_byte * name)
+sh_symbian_export (bfd * abfd ATTRIBUTE_UNUSED, char * name)
{
if (DEBUG)
fprintf (stderr, "EXPORT '%s'\n", name);
sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
asection * sec, bfd_byte * contents)
{
- bfd_byte *s;
- bfd_byte *e;
+ char *s;
+ char *e;
bfd_boolean result = TRUE;
bfd_size_type sz = sec->rawsize ? sec->rawsize : sec->size;
- for (s = contents, e = s + sz; s < e;)
+ for (s = (char *) contents, e = s + sz; s < e;)
{
- bfd_byte * directive = s;
+ char * directive = s;
switch (*s)
{
result = FALSE;
else
{
- bfd_byte * new_name;
- bfd_byte * new_name_end;
- bfd_byte name_end_char;
+ char * new_name;
+ char * new_name_end;
+ char name_end_char;
/* Skip the IMPORT directive. */
s += strlen (DIRECTIVE_IMPORT);
}
else
{
- bfd_byte * current_name;
- bfd_byte * current_name_end;
- bfd_byte current_name_end_char;
+ char * current_name;
+ char * current_name_end;
+ char current_name_end_char;
/* Skip the 'AS '. */
s += strlen (DIRECTIVE_AS);
result = FALSE;
else
{
- bfd_byte * name;
- bfd_byte * name_end;
- bfd_byte name_end_char;
+ char * name;
+ char * name_end;
+ char name_end_char;
/* Skip the directive. */
s += strlen (DIRECTIVE_EXPORT);
if (! result)
{
if (DEBUG)
- fprintf (stderr, "offset into .directive section: %d\n", directive - contents);
+ fprintf (stderr, "offset into .directive section: %ld\n",
+ (long) (directive - (char *) contents));
bfd_set_error (bfd_error_invalid_operation);
- _bfd_error_handler (_("%s: Unrecognised .directive command: %s"),
- bfd_archive_filename (abfd), directive);
+ _bfd_error_handler (_("%B: Unrecognised .directive command: %s"),
+ abfd, directive);
break;
}
}
new_sym.st_other = ELF_ST_VISIBILITY (STV_DEFAULT);
new_sym.st_shndx = SHN_UNDEF;
- if (! _bfd_elf_merge_symbol (input_bfd, info, ptr->new_name, & new_sym, & psec,
- & new_value, & new_hash, & skip, & override, & type_change_ok,
+ if (! _bfd_elf_merge_symbol (input_bfd, info,
+ ptr->new_name, & new_sym,
+ & psec, & new_value, NULL,
+ & new_hash, & skip,
+ & override, & type_change_ok,
& size_change_ok))
{
- _bfd_error_handler (_("%s: Failed to add renamed symbol %s"),
- bfd_archive_filename (input_bfd), ptr->new_name);
+ _bfd_error_handler (_("%B: Failed to add renamed symbol %s"),
+ input_bfd, ptr->new_name);
continue;
}
/* XXX - should we check psec, skip, override etc ? */
/* Allow the symbol to become local if necessary. */
if (new_hash->dynindx == -1)
- new_hash->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+ new_hash->def_regular = 1;
if (DEBUG)
fprintf (stderr, "Created new symbol %s\n", ptr->new_name);