Page 1 of 3

Who is responsible for Newlib/vbcc ?

Posted: Sat Apr 23, 2016 6:07 pm
by phx
I'm receiving bug reports that some dynamically linked Newlib programs, compiled with vbcc, write the following messages into the serial debug log:

Code: Select all

[elf] .sdata 0x7fd55440-0x7fd55440
Projektit:Ohjelmointi/ScoreGen/ScoreGen/ScoreGen (sh_flags 0x02)
      has read-only flag in section header
      but is located in a read-write section of the program header
      (linker (script) error?)
In my opinion the reason for it is that SDK/newlib/lib/startup.o doesn't include an .sdata section, although _SDA_BASE_ is referenced. Which means, when there is no small data in the main program, then vlink is forced to generate a dummy .sdata section to define _SDA_BASE_, as in the following fragment of Newlib's vbcc linker script:

Code: Select all

  .sdata          : {
    _LinkerDB = . + 0x8000;
    _SDA_BASE_ = . + 0x8000;
    *(.sdata .sdata.* .tocd)
  }
Unfortunately this dummy section is read-only, which causes the warning when the dynamic linker links a real read-write .sdata section to it.

It should be fixed in Newlib's startup.o or vbcc.ldscript. But both are not under my control. Can the responsible person please contact me by email to find a solution? Thanks in advance.

Re: Who is responsible for Newlib/vbcc ?

Posted: Thu May 05, 2016 4:34 pm
by blmara
*bump*

Really, are there people developing newlib.library? I have reported this problem to Frank Wille of VBCC. The error message comes up (captured with Sashimi) when starting or even C:Version-ing AmigaOS 4.1 FE version of AmiPDF (v. 1.25):

Code: Select all

[elf] .gcc_except_table 0x57296f14-0x5729a2b4 System:Utilities/AmiPDF/AmiPDF (sh_flags 0x02)
      has read-only flag in section header
      but is located in a read-write section of the program header
      (linker (script) error?)
Here is another example using C:Version with MindSpace2_v.0.06, yes I know it's very early release:

Code: Select all

elf] .hash 0x7fb3b000-0x7fb3b4cc System:SObjs/libgcc.so (sh_flags 0x02)
      has read-only flag in section header
      but is located in a read-write section of the program header
      (linker (script) error?)
[elf] .dynsym 0x7fb3b4cc-0x7fb3bfac System:SObjs/libgcc.so (sh_flags 0x02)
      has read-only flag in section header
      but is located in a read-write section of the program header
      (linker (script) error?)
[elf] .dynstr 0x7fb3bfac-0x7fb3c78a System:SObjs/libgcc.so (sh_flags 0x02)
      has read-only flag in section header
      but is located in a read-write section of the program header
      (linker (script) error?)
[elf] .rela.data 0x7fb3c78c-0x7fb3c7a4 System:SObjs/libgcc.so (sh_flags 0x02)
      has read-only flag in section header
      but is located in a read-write section of the program header
      (linker (script) error?)
[elf] .rela.dyn 0x7fb3c7a4-0x7fb3cb1c System:SObjs/libgcc.so (sh_flags 0x02)
      has read-only flag in section header
      but is located in a read-write section of the program header
      (linker (script) error?)
[elf] .rela.plt 0x7fb3cb1c-0x7fb3cc9c System:SObjs/libgcc.so (sh_flags 0x02)
      has read-only flag in section header
      but is located in a read-write section of the program header
      (linker (script) error?)
DOS] ERROR: During ElfLoadSeg(); Elf32_Error=10; File="work:MindSpace2_v0.06/MindSpace2"
Marko

Re: Who is responsible for Newlib/vbcc ?

Posted: Fri May 06, 2016 9:33 am
by broadblues
What system are you guys using?

FE or Update 6?

which machine

I don't see these messages on FE: on my x1k nor on my SAM 440

Re: Who is responsible for Newlib/vbcc ?

Posted: Fri May 06, 2016 12:08 pm
by tonyw
I remember that error message from years ago. It was harmless as I recall, just a message to the effect that an elf section was R/W instead of RO, or something like that.

So what's the problem?

Re: Who is responsible for Newlib/vbcc ?

Posted: Sat May 07, 2016 8:38 am
by blmara
broadblues wrote:What system are you guys using?

FE or Update 6?

which machine

I don't see these messages on FE: on my x1k nor on my SAM 440
AmigaOS 4.1 FE on a X1000.
I remember that error message from years ago. It was harmless as I recall, just a message to the effect that an elf section was R/W instead of RO, or something like that.

So what's the problem?
Harmless maybe, but showing that there's a bug, somewhere. And cluttering Sashimi output.

Marko

Re: Who is responsible for Newlib/vbcc ?

Posted: Sun May 22, 2016 11:08 pm
by blmara
So, could the newlib maintainer address this problem?

Marko

Re: Who is responsible for Newlib/vbcc ?

Posted: Mon May 23, 2016 12:19 am
by tonyw
AFAIR, it wasn't a newlib issue, but in adtools. Newlib has not been changed for a couple of years (newlib.library 53.30 (12/02/2014)).

Again IIRC, I think it went away with a later build of adtools/gcc. Are you sure you have the latest SDK?

We don't maintain this stuff and we don't have people to take off more important projects.

Re: Who is responsible for Newlib/vbcc ?

Posted: Mon May 23, 2016 7:49 am
by zzd10h
No problem for me but I have the same output with one of my program, aTunes.

In Sashimi, a lot of :
[elf] .hash 0x7f5cf000-0x7f5cf4cc OS4_FE:SObjs/libgcc.so (sh_flags 0x02)
has read-only flag in section header
but is located in a read-write section of the program header
(linker (script) error?)

Recompiled with current public SDK/FE (the same problem with previous one/4.1.6)

Re: Who is responsible for Newlib/vbcc ?

Posted: Mon May 23, 2016 2:35 pm
by tonyw
I just checked my clean Final Edition partition and I get no such error messages there.

Nor do I on the beta partition with all the latest beta components. I really don't remember how long ago it happened, but I'm pretty sure that it was fixed years ago.

Re: Who is responsible for Newlib/vbcc ?

Posted: Mon May 23, 2016 3:32 pm
by xenic
Since VBCC hasn't been included in the OS4 SDK since SDK v53.15 (2009), I'm guessing that VBCC is no longer supported by the OS4 dev team. You should probably switch to GCC.