diff options
author | Marcus Shawcroft <marcus.shawcroft@gmail.com> | 2015-03-20 18:54:59 +0000 |
---|---|---|
committer | Marcus Shawcroft <marcus.shawcroft@arm.com> | 2015-03-23 16:14:14 +0000 |
commit | 35fee8b77bc6f90d86b19fcacb677a2670d036e8 (patch) | |
tree | 1ff8d05dd4bf082751557ab97fabc6cf06dd073a /bfd/elfnn-aarch64.c | |
parent | 13f622ec5967f0a56d5876e7c7305c260cb4928f (diff) | |
download | gdb-35fee8b77bc6f90d86b19fcacb677a2670d036e8.zip gdb-35fee8b77bc6f90d86b19fcacb677a2670d036e8.tar.gz gdb-35fee8b77bc6f90d86b19fcacb677a2670d036e8.tar.bz2 |
Factor out _bfd_aarch64_erratum_835769_stub_name
Diffstat (limited to 'bfd/elfnn-aarch64.c')
-rw-r--r-- | bfd/elfnn-aarch64.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index d5a64b5..c9e3a55 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -3013,6 +3013,15 @@ elf_aarch64_compare_mapping (const void *a, const void *b) } +static char * +_bfd_aarch64_erratum_835769_stub_name (unsigned num_fixes) +{ + char *stub_name = (char *) bfd_malloc + (strlen ("__erratum_835769_veneer_") + 16); + sprintf (stub_name,"__erratum_835769_veneer_%d", num_fixes); + return stub_name; +} + /* Scan for cortex-a53 erratum 835769 sequence. Return TRUE else FALSE on abnormal termination. */ @@ -3077,13 +3086,8 @@ erratum_835769_scan (bfd *input_bfd, if (aarch64_erratum_sequence (insn_1, insn_2)) { - char *stub_name = NULL; - stub_name = (char *) bfd_malloc - (strlen ("__erratum_835769_veneer_") + 16); - if (stub_name != NULL) - sprintf - (stub_name,"__erratum_835769_veneer_%d", num_fixes); - else + char *stub_name = _bfd_aarch64_erratum_835769_stub_name (num_fixes); + if (! stub_name) return FALSE; if (num_fixes == fix_table_size) |