Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2020-04

Is there a less clumsy way to define a weak procedure?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Ring

I have to define a weak procedure in implementation of a unit to make the linker happy in a special case:

procedure vPortFree; external name 'vPortFree';

procedure vPortFreeStub; assembler; nostackframe;
asm
  .long vPortFree
  .weak vPortFree
  .set  vPortFree,vPortFreeStub
  bkpt
end;

is there a more elegant way to do this? My target is arm-freertos. The function is actually never called, this is why it consists of a bkpt.

Michael

Reply by email

Jonas Maebe
to Michael Ring
Michael Ring wrote
I have to define a weak procedure in implementation of a unit to make the linker happy in a special case:

There is no support yet in the compiler to define weak symbols, only create weak references to (external) symbols.

Jonas

Reply by email