MIPS Creator CI20 patches (again)

Paul Boddie paul at boddie.org.uk
Sun Jan 7 14:15:13 CET 2018


Sorry to follow up on myself again...

On Thursday 21. December 2017 01.55.51 Paul Boddie wrote:
> On Wednesday 20. December 2017 16.52.45 Paul Boddie wrote:
> > However, another problem has emerged when trying to build L4Re. It
> > appears that something changed between r72 and r73, and now, when I try
> > and build L4Re, I get a linker error as described in the following
> > Debian bug report:
> > 
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884821
> > 
> > ----
> > mipsel-linux-gnu-ld: main.o: Can't find matching LO16 reloc against
> > `.text' for R_MIPS_GOT16 at 0x1f8 in section `mipsel-linux-gnu-ld: BFD
> > (GNU Binutils for Debian) 2.29.1 internal error, aborting at
> > ../../bfd/bfd.c:866 in _bfd_doprnt

This specific internal error is a bug in binutils when producing the error 
message, but the error causing the message is a genuine problem.

In pkg/examples/sys/utcb-ipc/main.c, expanding the L4UTIL_THREAD_STATIC_FUNC 
macro by hand, I get the following:

EXTERN_C_BEGIN
void __attribute__((visibility("internal"))) thread2(void);
static void __attribute__((used)) thread2_worker_function(void);
asm (
  ".type thread2, function \n"
  "thread2 : \n .set push; .set noreorder;"
  L4UTIL_THREAD_START_SETUP_GP
  "la $t9, thread2_worker_function\n"
  "  jal $t9 \n"
  "   nop    \n"
  ".set pop"
);
EXTERN_C_END
static L4_NORETURN void thread2_worker_function(void)
{
...
}

It seems that the problem is caused by the declaration of thread2. If I 
replace that with this...

static void thread2(void);

...the error associated with the output goes away (although I get a warning 
from the compiler about thread2 not being defined, which happens in the 
assembly language code, of course). But obviously, this isn't a proper 
solution.

Paul




More information about the l4-hackers mailing list