yehuda marko via llvm-dev
2021-Nov-23 16:37 UTC
[llvm-dev] How to place a variable / function at a given absolute address in memory
Hello , I’m using llvm 8 , and I want to know , How to place a variable / function at a given absolute address in memory. Re, Yehuda Marko -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211123/6ebb3753/attachment-0001.html>
Peter Smith via llvm-dev
2021-Nov-23 16:46 UTC
[llvm-dev] How to place a variable / function at a given absolute address in memory
Placing a variable / function at a specific address requires the cooperation of the linker and depending on where you are running the program, the OS. The following stack-overflow question, although relating to GCC, it also can be applied to LLVM https://stackoverflow.com/questions/4067811/how-to-place-a-variable-at-a-given-absolute-address-in-memory-with-gcc Essentially you need to compile the variable or function in a named section and then place the named section using a linker script, all assuming the linker you are using can support that. Hope that helps Peter From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of yehuda marko via llvm-dev Sent: 23 November 2021 16:37 To: llvm-dev at lists.llvm.org Subject: [llvm-dev] How to place a variable / function at a given absolute address in memory Hello , I’m using llvm 8 , and I want to know , How to place a variable / function at a given absolute address in memory. Re, Yehuda Marko -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211123/b2a34f02/attachment.html>
Mehmet Erol Sanliturk via llvm-dev
2021-Nov-23 17:50 UTC
[llvm-dev] How to place a variable / function at a given absolute address in memory
Is this possible in operating systems that are used today ? My opinion is that you can do this only by using operating system facilities because the memory areas are managed by the operating system and no one else ( including LLVM ) can modify these area definitions . Mehmet Erol Sanliturk On Tue, Nov 23, 2021 at 7:37 PM yehuda marko via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hello , > > > > I’m using llvm 8 , and I want to know , How to place a variable / function > at a given absolute address in memory. > > > > > > Re, > > Yehuda Marko > > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211123/741ca6b4/attachment.html>