Switching from Pelles C version 8 to version 10

Started by Jean-Pierre Leroy, February 17, 2021, 10:46:21 AM

Previous topic - Next topic

Jean-Pierre Leroy

Dear all,

Until now I was using Pelles C compiler version 8 with an external library called Virtual Print Engine version 7.20 (Professional Edition 32 bit - licence); more on Virtual Print Engine here : https://www.idealsoftware.com/en/pdf-library/report-engine.html

Recently I've tested my C source codes with the latest version of Pelles C compiler version 10 and now I have this warning : (see also the enclosed screenshot).

POLINK: warning: Realigned section '.idata$2' in object 'vpep3272.lib(vpep3272.dll)' (from 4 to 1 byte(s)).

So I have some questions :

Q1. What is the importance of this warning ?
Q2. Is there a way to avoid this warning ?
Q3. Why I have this warning only with Pelles C version 10 ?
Q4. Do you think this warning could break something in the executable file ?

Thanks for your help.

Regards,
Jean-Pierre LEROY

Jean-Pierre Leroy

With Pelles C version 8.00.60 or Pelles C version 9.00.9 it works perfectly, I did not get the warning.

TimoVJL

If you create a new import library with polib for dll, warnings disappear ?
May the source be with you

Jean-Pierre Leroy

I tried with a new import library made with polib for dll but I get many more errors:

POLINK: error: Unresolved external symbol '_VpePrintDoc@8' - referenced from 'E:\Projets\Pelles C 10 - App\ApplicationEtiquettesColisClients\output\FonctionsVPE.obj'.

frankie

#4
The PE section '.idata$2' holds import table descriptors array. The section should be aligned on a 4 bytes boundary, the warning seem to advice that the import library arguably align the section on 1 byte boundary (the linker realigned the section on 1 byte boundary).
Not sure if this really lead to an access problem in the OS image loader, we have also consider that even if aligned on 1 byte boundary, maybe the first location, when loaded in memory, will be on a 4 bytes aligned address anyway by coincidence.
What exactly is the meaning of the warning isn't documented, or I haven't found it, and it would be fine if Pelle would explain the issue.
Anyway what isn't clear is: "Does the compiled code works?". If yes you can assume that there is no problem going on.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

TimoVJL

#5
Actually i meant a cleaning procedure for import library.
POLIB xxx.lib /MAKEDEF:xxx.def
after that in different location
POLIB /DEF:xxx.def /OUT:xxx.lib

Import library from 32-bit dll without decoration is just difficult
It is possible do it from polink error list, but only exported functions, not static ones.
May the source be with you

Jean-Pierre Leroy

@TimoVJL : I followed the cleaning procedure, but then I've 7 warnings (see the screenshot)

@frankie : to answer your question "Does the compiled code works?". The answer is Yes the code works properly.

So maybe it is a question for Pelle : Is-it possible that this warning was not shown with POLINK.EXE provided with PellesC version 8 and 9 and that this warning is only detected with POLINK.EXE provided with PellesC Version 10 ?

Jean-Pierre Leroy

#7
The situation is more clear for me now:

With PellesC Version 10 and POLINK.EXE provided with PellesC Version 10 : I get the warning and the code runs properly.
With PellesC Version 10 and POLINK.EXE provided with PellesC Version 9   : I didn't get the warning and the code runs properly.

So I suppose that POLINK.EXE has been improved with PellesC Version 10 and is now able to detect additional warnings that was not detected with earlier versions of POLINK.EXE. Pelle can you confirm ?

Thanks

TimoVJL

#8
I forgot /MACHINE:x86 switch
I don't think that warning isn't harmful.
May the source be with you

Pelle

The realigned warning was added to version 10. It was added because the alignments changed in POLINK (to account for X64 machines, among other things). This is an informational warning, unlike some other warnings, but there are no warning levels in POLINK and no way to disable a warning. I have no plans to change this.

The easy "fix" is to rebuild your import library with version 10.

The names in you screenshot contains decorated names for a 32-bit machines, but the default is now a 64-bit machine, so perhaps there is a mismatch somewhere...?
/Pelle

Jean-Pierre Leroy

Dear all,

I followed your advices and rebuild the import library with version 10 and the /MACHINE:x86 switch  (thanks to TimoVJL)

POLIB VPEP3272.lib /MAKEDEF:VPEP3272.def /MACHINE:x86

Then in a different location (thanks to TimoVJL)

POLIB /DEF:VPEP3272.def /OUT:VPEP3272.lib /MACHINE:x86

And now with new import library I didn't get anymore warning  :)

Thank you all for your help.