Renato Golin via llvm-dev
2017-May-03 10:52 UTC
[llvm-dev] Help with setting up ARM embedded clang + lld
On 2 May 2017 at 23:59, Rui Ueyama <ruiu at google.com> wrote:> That's interesting. Usually your code wouldn't be gc'ed because your entire > code is reachable from _start.Baremetal doesn't need a _start.> Does your program depend on the feature that, if no -e option is given, the > linker sets the beginning of the .text section to the entry point address?I believe that would help, yes. But there may be linker scripts that can change that, so you need to be careful. cheers, --renato
Rui Ueyama via llvm-dev
2017-May-03 18:51 UTC
[llvm-dev] Help with setting up ARM embedded clang + lld
On Wed, May 3, 2017 at 3:52 AM, Renato Golin <renato.golin at linaro.org> wrote:> On 2 May 2017 at 23:59, Rui Ueyama <ruiu at google.com> wrote: > > That's interesting. Usually your code wouldn't be gc'ed because your > entire > > code is reachable from _start. > > Baremetal doesn't need a _start. > > > > Does your program depend on the feature that, if no -e option is given, > the > > linker sets the beginning of the .text section to the entry point > address? > > I believe that would help, yes. But there may be linker scripts that > can change that, so you need to be careful. >If you want to do GC, you still need to teach linkers GC root symbols in some way, no? Otherwise, linkers cannot determine if a section is live or not. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170503/32535edd/attachment.html>
Scott Shawcroft via llvm-dev
2017-May-04 16:48 UTC
[llvm-dev] Help with setting up ARM embedded clang + lld
On Wed, May 3, 2017, at 11:51 AM, Rui Ueyama wrote:> On Wed, May 3, 2017 at 3:52 AM, Renato Golin > <renato.golin at linaro.org> wrote:>> On 2 May 2017 at 23:59, Rui Ueyama <ruiu at google.com> wrote: >> > That's interesting. Usually your code wouldn't be gc'ed because >> > your entire code is reachable from _start. >> >> Baremetal doesn't need a _start.>> >> >> > Does your program depend on the feature that, if no -e option is >> > given, the linker sets the beginning of the .text section to the >> > entry point address? >> >> I believe that would help, yes. But there may be linker scripts that>> can change that, so you need to be careful. > > If you want to do GC, you still need to teach linkers GC root symbols > in some way, no? Otherwise, linkers cannot determine if a section is > live or not.Yeah totally. I had marked some sections as used previously but haven't had a chance to look further into it. I'll try to take some time this weekend to poke at it further. The project I'm working on is here: https://github.com/tannewt/circuitpython/tree/clang/atmel-samd in case you can't wait.Thanks, Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170504/579d52d8/attachment.html>