This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiler name mangling

Hi,
Having wondered why the linker couldn't locate a code segment which I'd specified as part of the BL51 command line, I took a look at listing file to discover that the compiler had (somewhat arbitrarily) appended an underscore to some of the function names, hence the link error. Is there a means of inhibiting (or predicting)this annoying compiler characteristic?

Thanks!

Parents Reply Children
  • A function name has an underscore prepended if the function has any parameters. No parameters, no underscore. Goodness knows why...

    This is incorrect.

    In the compiler manual, there is a section named "Segment Naming Conventions". In that section, is a sub-section named, "Program Objects".

    Under "Program Objects", there is a table that discusses the naming conventions for functions. A segment with an _ prefix indicates that arguments for that function are passed in registers.

    If you do not want your arguments to be passed in registers, use the NOREGPARMS directive.

    Jon