gcc turns the strncat() into an implicit call to strlen() and some form
of expanded memcpy(). E.g.
if (preempt_count() != count) {
strncat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
preempt_count() = count;
}
becomes
cmp.l 884(%a2),%d6 | <variable>.thread.info.preempt_count, count
jeq .L61 |
move.l %d7,-(%sp) | tmp76,
jbsr strlen |
addq.l #4,%sp |,
move.l %d7,%a0 | tmp76, tmp80
add.l %d0,%a0 |, tmp80
move.l #1886545253,(%a0)+ |,
move.l #1836086377,(%a0)+ |,
move.l #1869488233,(%a0)+ |,
move.l #1835164012,(%a0)+ |,
move.l #1634624357,(%a0)+ |,
move.w #8192,(%a0) |,* D.28541
move.l %d6,884(%a2) | count, <variable>.thread.info.preempt_count
.L61:
All other explicit calls to strlen() are inlined, as per
include/asm-m68k/string.h.
Actually it build and runs fine after s/strncat/strlcat/...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--