From 61ac7e364632210f7f274ec454d546846190c38e Mon Sep 17 00:00:00 2001 From: kan Date: Mon, 22 Dec 2003 04:27:17 +0000 Subject: Fix ASM_OUTPUT_LABELREF to deal with TSL model prefixes GCC started to use internally. They need to be stripped before the name of the label or symbol is printed. --- contrib/gcc/config/i386/freebsd.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'contrib/gcc/config') diff --git a/contrib/gcc/config/i386/freebsd.h b/contrib/gcc/config/i386/freebsd.h index be9729c..3cdfdb2 100644 --- a/contrib/gcc/config/i386/freebsd.h +++ b/contrib/gcc/config/i386/freebsd.h @@ -153,18 +153,26 @@ Boston, MA 02111-1307, USA. */ #undef ASM_OUTPUT_LABELREF #define ASM_OUTPUT_LABELREF(FILE, NAME) \ do { \ - char *_name = (NAME); \ + const char *xname = (NAME); \ /* Hack to avoid writing lots of rtl in \ FUNCTION_PROFILER_EPILOGUE (). */ \ - if (*_name == '.' && strcmp(_name + 1, "mexitcount") == 0) \ + if (*xname == '.' && strcmp(xname + 1, "mexitcount") == 0) \ { \ if (flag_pic) \ - fprintf ((FILE), "*%s@GOT(%%ebx)", _name); \ + fprintf ((FILE), "*%s@GOT(%%ebx)", xname); \ else \ - fprintf ((FILE), "%s", _name); \ + fprintf ((FILE), "%s", xname); \ + } \ + else \ + { \ + if (xname[0] == '%') \ + xname += 2; \ + if (xname[0] == '*') \ + xname += 1; \ + else \ + fputs (user_label_prefix, FILE); \ + fputs (xname, FILE); \ } \ - else \ - fprintf (FILE, "%s", _name); \ } while (0) /* This is how to hack on the symbol code of certain relcalcitrant -- cgit v1.1