Skip to contentSkip to conversation

ENTRY-macro in linkage.h

DISCUSSION Uwe Reimann 2 participants 3 messages Feb 8, 2003 – Feb 9, 2003 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

I'm currently porting linux to TI's TMS320C31. I'm using c4x-gcc, which has a problem with the ENTRY-macro from linkage.h. c4x-gcc will accept the generated .globl-directive only if it is preceded by whitescape. Right know, gcc thinks I want to create a label called .globl. Any ideas how to fix this without fixing gcc?

Regards, Uwe

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

My problem is how to add the whitespace. The preprocessor seems to strip it. Consider this (test.S):

#define ENTRY(X) \
.global X##; \
X##:

ENTRY(foo)
ENTRY(bar)

gcc -S test.S:

.global foo; foo:
.global bar; bar:

For c4x-gcc, this has to be like this:

.global foo
foo:
.global bar
bar:

Without the leading whitespace, .global is taken as a name of a label. Without the newline before the labels, they are not recognized (taken as comments).

How can I tell the preprocessor to emit spaces and newlines?

Quoted 16 lines · Alan Cox
Quoted 5 lines · Uwe Reimann

Hi,

I'm currently porting linux to TI's TMS320C31. I'm using c4x-gcc, which has a problem with the ENTRY-macro from linkage.h. c4x-gcc will accept the generated .globl-directive only if it is preceded by whitescape. Right know, gcc thinks I want to create a label called .globl. Any ideas how to fix this without fixing gcc?

I think every other port will probably be fine with the whitespace present so I guess add a space 8)

#3 lore raw

Hi,

Quoted 17 lines · Uwe Reimann

My problem is how to add the whitespace. The preprocessor seems to strip it. Consider this (test.S):

#define ENTRY(X) \
.global X##; \
X##:

ENTRY(foo)
ENTRY(bar)

gcc -S test.S:

.global foo; foo:
.global bar; bar:

For c4x-gcc, this has to be like this:

Quoted 8 lines

.global foo
foo:
.global bar
bar:

Without the leading whitespace, .global is taken as a name of a label. Without the newline before the labels, they are not recognized (taken as comments).

You don't have to use the ENTRY macro anymore, it was useful when kernel could be in a.out format, so the underscore was automatically prepended to the symbol.

bye, Roman