mirror of git://gcc.gnu.org/git/gcc.git
intelmic-mkoffload.c (prepare_target_image): Handle all non-alphanumeric characters in the symbol name.
* config/i386/intelmic-mkoffload.c (prepare_target_image): Handle all non-alphanumeric characters in the symbol name. From-SVN: r227522
This commit is contained in:
parent
12dee005f7
commit
b11e7db713
|
|
@ -1,3 +1,8 @@
|
||||||
|
2015-09-07 Ilya Verbin <ilya.verbin@intel.com>
|
||||||
|
|
||||||
|
* config/i386/intelmic-mkoffload.c (prepare_target_image): Handle all
|
||||||
|
non-alphanumeric characters in the symbol name.
|
||||||
|
|
||||||
2015-09-07 Marek Polacek <polacek@redhat.com>
|
2015-09-07 Marek Polacek <polacek@redhat.com>
|
||||||
|
|
||||||
PR inline-asm/67448
|
PR inline-asm/67448
|
||||||
|
|
|
||||||
|
|
@ -453,17 +453,18 @@ prepare_target_image (const char *target_compiler, int argc, char **argv)
|
||||||
fork_execute (objcopy_argv[0], CONST_CAST (char **, objcopy_argv), false);
|
fork_execute (objcopy_argv[0], CONST_CAST (char **, objcopy_argv), false);
|
||||||
|
|
||||||
/* Objcopy has created symbols, containing the input file name with
|
/* Objcopy has created symbols, containing the input file name with
|
||||||
special characters replaced with '_'. We are going to rename these
|
non-alphanumeric characters replaced by underscores.
|
||||||
new symbols. */
|
We are going to rename these new symbols. */
|
||||||
size_t symbol_name_len = strlen (target_so_filename);
|
size_t symbol_name_len = strlen (target_so_filename);
|
||||||
char *symbol_name = XALLOCAVEC (char, symbol_name_len + 1);
|
char *symbol_name = XALLOCAVEC (char, symbol_name_len + 1);
|
||||||
for (size_t i = 0; i <= symbol_name_len; i++)
|
for (size_t i = 0; i < symbol_name_len; i++)
|
||||||
{
|
{
|
||||||
char c = target_so_filename[i];
|
char c = target_so_filename[i];
|
||||||
if (c == '/' || c == '.' || c == '-')
|
if (!ISALNUM (c))
|
||||||
c = '_';
|
c = '_';
|
||||||
symbol_name[i] = c;
|
symbol_name[i] = c;
|
||||||
}
|
}
|
||||||
|
symbol_name[symbol_name_len] = '\0';
|
||||||
|
|
||||||
char *opt_for_objcopy[3];
|
char *opt_for_objcopy[3];
|
||||||
opt_for_objcopy[0] = XALLOCAVEC (char, sizeof ("_binary__start=")
|
opt_for_objcopy[0] = XALLOCAVEC (char, sizeof ("_binary__start=")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue