This is the mail archive of the
mailing list for the GCC project.
Re: Alignment of .rodata symbols wasting space
- From: Ishwar Rattan <ishwar at pali dot cps dot cmich dot edu>
- To: John Carter <john dot carter at tait dot co dot nz>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 12 May 2005 20:53:31 -0400 (EDT)
- Subject: Re: Alignment of .rodata symbols wasting space
- References: <Pine.LNX.firstname.lastname@example.org>
If I recall correctly the data has to be properly aligned
for correct access under SPARC else you might see bus-error
run time errors..
On Fri, 13 May 2005, John Carter wrote:
> I am linking an executable for an embedded target with very limited
> rom/ram resources.
> While analysing our space requirements I noted a fairly large discrepancy
> between the amount of rodata reported by readelf vs adding up the
> individual symbols reported by objdump --syms. (About a factor 1.5)
> As far as I can see, there are two sources for this discrepancy...
> 1) Alignment. (1 byte symbol followed by a 4 byte aligned symbol)
> 2) Some large mysterious other thing between the last symbol and the end
> of the rodata segment..
> Question 1)
> Any ld flags / linking script options / ... that I can use to pack all
> byte aligned objects together?
> Question 2)
> Any guesses as to what are the mystery rodata items that are not showing
> up in objdump --syms?
> Question 3)
> Are these problems perhaps an artifact of the somewhat elderly version
> of the toolchain we are using? ie. Would upgrading solve this problem?
> sparc-rtems-gcc 2.95.2
> sparc-rtems-objdump 2.11
> John Carter Phone : (64)(3) 358 6639
> Tait Electronics Fax : (64)(3) 359 4632
> PO Box 1645 Christchurch Email : email@example.com
> New Zealand