SIZEOF and .tbss

Nathan Sidwell nathan@codesourcery.com
Mon Feb 23 11:41:00 GMT 2004


For an embedded system, I was trying to write a linker script which generated
a table of data image locations, something like
    .map : {
      LONG (ADDR (.data)) LONG (LOADADDR(.data)) SIZEOF (.data) SIZEOF (.bss)
      LONG (ADDR (.tdata)) LONG (LOADADDR(.tdata)) SIZEOF (.tdata) SIZEOF (.tbss)
    }
The idea being that part of crt0 would copy and initialize these areas.
Unfortunately SIZEOF (.tbss) is always zero, because of the way the linker
has to allow .tdata,.tbss to occupy the loadable image, without forcing
a gap where .tbss is.

This patch implements that functionality in a different manner. Rather than
lie about .tbss's size, I tweak the couple of places that need to know
it can be ignored for layout purposes.

tested on i686-pc-linux-gnu & ia64-unknown-linux-gnu, ok?

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tls.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20040223/db9b07a1/attachment.ksh>


More information about the Binutils mailing list