NO

Author Topic: Switching from Pelles C version 8 to version 10  (Read 178 times)

Offline Jean-Pierre Leroy

  • Member
  • *
  • Posts: 8
Switching from Pelles C version 8 to version 10
« on: February 17, 2021, 10:46:21 am »
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
« Last Edit: February 19, 2021, 01:47:59 pm by Jean-Pierre Leroy »

Offline Jean-Pierre Leroy

  • Member
  • *
  • Posts: 8
Re: Switching from Pelles C version 8 to version 10
« Reply #1 on: February 17, 2021, 06:37:02 pm »
With Pelles C version 8.00.60 or Pelles C version 9.00.9 it works perfectly, I did not get the warning.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1922
Re: Switching from Pelles C version 8 to version 10
« Reply #2 on: February 18, 2021, 04:33:31 pm »
If you create a new import library with polib for dll, warnings disappear ?
May the source be with you

Offline Jean-Pierre Leroy

  • Member
  • *
  • Posts: 8
Re: Switching from Pelles C version 8 to version 10
« Reply #3 on: February 18, 2021, 10:40:40 pm »
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'.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1792
Re: Switching from Pelles C version 8 to version 10
« Reply #4 on: February 19, 2021, 12:19:11 am »
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.
« Last Edit: February 19, 2021, 12:21:22 am by frankie »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1922
Re: Switching from Pelles C version 8 to version 10
« Reply #5 on: February 19, 2021, 08:55:56 am »
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.
« Last Edit: February 19, 2021, 11:04:11 am by TimoVJL »
May the source be with you

Offline Jean-Pierre Leroy

  • Member
  • *
  • Posts: 8
Re: Switching from Pelles C version 8 to version 10
« Reply #6 on: February 20, 2021, 09:49:34 pm »
@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 ?

Offline Jean-Pierre Leroy

  • Member
  • *
  • Posts: 8
Re: Switching from Pelles C version 8 to version 10
« Reply #7 on: February 20, 2021, 10:16:40 pm »
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
« Last Edit: February 20, 2021, 10:18:43 pm by Jean-Pierre Leroy »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1922
Re: Switching from Pelles C version 8 to version 10
« Reply #8 on: February 21, 2021, 10:09:51 am »
I forgot /MACHINE:x86 switch
I don't think that warning isn't harmful.
« Last Edit: February 21, 2021, 10:12:04 am by TimoVJL »
May the source be with you

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2101
    • http://www.smorgasbordet.com
Re: Switching from Pelles C version 8 to version 10
« Reply #9 on: February 21, 2021, 05:13:47 pm »
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

Offline Jean-Pierre Leroy

  • Member
  • *
  • Posts: 8
Re: Switching from Pelles C version 8 to version 10
« Reply #10 on: February 21, 2021, 09:58:57 pm »
Dear all,

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

Code: [Select]
POLIB VPEP3272.lib /MAKEDEF:VPEP3272.def /MACHINE:x86
Then in a different location (thanks to TimoVJL)

Code: [Select]
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.