On Fri, Oct 1, 2021 at 3:54 AM T Odin <thorodinsoraven...@gmail.com> wrote:
>
> I'm trying to run an executable built from Go source on a target environment 
> based out of Linux.
> Loader on the target machine is customized and expects the elf sections to be 
> in a different order.
>
> I checked the Go source' link option in asm.go where it formats the elf 
> header.
> https://github.com/golang/go/tree/master/src/cmd/link/internal/amd64
>
> From my understanding, it requires this implementation to be changed to run 
> on my target platform.
> Is there any other way, like linker script (used in Linux) which can be used 
> to build Go executable?

The Go linker itself doesn't support linker scripts.

It may work to do something like -ldflags="-linkmode=external
-extldflags=-Tmylinkerscript".

Note that it's quite peculiar for a Linux implementation to require
ELF sections to be in a particular order.  I don't understand what
would impose such a requirement.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcW8pPWX6DLEvu%3DdoXbDshiXJt_%2BRYw%2B1zeSFNmQT4yNDQ%40mail.gmail.com.

Reply via email to