1

I'm trying to place libc functions like memcpy, memset etc in specific sections of memory. I tried doing smth like this:

.section1
{
    /path/to/libc.a
    otherobj.o
}
.section2
{
    *(.text)
}

.section3
{
    *(.data .bss)
}

using gcc's ld tool with this script and the -map option, I check out the mapfile generated and see that memcpy and other symbols still appear in sections 2 and 3.

WORKAROUND:

Finally i just extracted the lib file to its collection of object files and placed them individually where i liked.

Community
  • 1
  • 1
ordahan
  • 187
  • 9
  • Why? What are you *really* trying to do? This sounds a lot like [the XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). – Bo Persson Oct 26 '12 at 21:37
  • My problem is literally trying to put the libc code in a specific section of memory which is faster. I use static linking and must place only the libc code in that section and nothing else. – ordahan Oct 27 '12 at 08:32

0 Answers0