public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* powerpc-eabi-ld (relaxing)
@ 2000-08-29 19:04 Reini, Dave
  2000-08-30  9:36 ` ppc map file is unordered Jeff Bevis
  0 siblings, 1 reply; 4+ messages in thread
From: Reini, Dave @ 2000-08-29 19:04 UTC (permalink / raw)
  To: 'crossgcc@sourceware.cygnus.com'

Hello,

I've been using a gcc cross compiler with target powerpc-elf
and host sparc-sun-solaris2.7.
I create a number of intermediate .o files with powerpc-eabi-ld,
then combine all those .o files to create the .elf.
It has been working fine, but I've run into a situation where
sections of the .sbss from different intermediate .o's end up
getting overlapped in the final link. For some reason (looking at the map
file),
the size of the sbss section in one .o has been reduced after
"relaxing". It shows the correct size before relaxing. Does
anyone know what is happening on a relax?

Thanks,


Dave Reini

dreini@celoxnetworks.com


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* ppc map file is unordered
  2000-08-29 19:04 powerpc-eabi-ld (relaxing) Reini, Dave
@ 2000-08-30  9:36 ` Jeff Bevis
  2000-08-30 10:52   ` Art Berggreen
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Bevis @ 2000-08-30  9:36 UTC (permalink / raw)
  To: crossgcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3019 bytes --]

The map files generated by ld are usually sorted badly.  Mostly, the
offsets increase as you progress through the file.  However, a large
number of them are not.  This causes a lot of headaches when trying
to find out what is at a particular offset, which I need to do from time
to time.  The linker is powerpc-eabi-ld version 2.9.1 (with BFD
2.9.1).  Here's a partial example:

 .text         
0x00001cac      0x518 obj/cache.o
               
0x00001e30               
CacheDataCtrlSafe
               
0x00001cac               
CacheInit
               
0x00002170               
K_CacheInstFlush
               
0x00002058               
K_CacheDataSyncRange
               
0x00001f28               
CacheInstCtrlSafe
               
0x0000219c               
CacheInstFlushSafe
               
0x00001fb4               
K_CacheDataFlush
               
0x000020bc               
CacheDataSyncRangeSafe
               
0x000020e4               
K_CacheDataFlushRange
               
0x00001d88               
K_CacheInstStat
               
0x00001ecc               
K_CacheInstCtrl
               
0x00001d3c               
K_CacheDataStat
               
0x00002148               
CacheDataFlushRangeSafe
               
0x00002008               
CacheDataFlushSafe
               
0x00001dd4               
K_CacheDataCtrl

Any idea why it lists the offsets out of order?  Is there an
easy fix for this?  Anyone?  Thanks...




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ppc map file is unordered
  2000-08-30  9:36 ` ppc map file is unordered Jeff Bevis
@ 2000-08-30 10:52   ` Art Berggreen
  0 siblings, 0 replies; 4+ messages in thread
From: Art Berggreen @ 2000-08-30 10:52 UTC (permalink / raw)
  To: Jeff Bevis; +Cc: crossgcc

Jeff Bevis wrote:
> 
> The map files generated by ld are usually sorted badly.  Mostly, the
> offsets increase as you progress through the file.  However, a large
> number of them are not.  This causes a lot of headaches when trying to
> find out what is at a particular offset, which I need to do from time
> to time.  The linker is powerpc-eabi-ld version 2.9.1 (with BFD
> 2.9.1).  Here's a partial example:
> 
>  .text          0x00001cac      0x518 obj/cache.o
>                 0x00001e30                CacheDataCtrlSafe
>                 0x00001cac                CacheInit
>                 0x00002170                K_CacheInstFlush
>                 0x00002058                K_CacheDataSyncRange
>                 0x00001f28                CacheInstCtrlSafe
>                 0x0000219c                CacheInstFlushSafe
>                 0x00001fb4                K_CacheDataFlush
>                 0x000020bc                CacheDataSyncRangeSafe
>                 0x000020e4                K_CacheDataFlushRange
>                 0x00001d88                K_CacheInstStat
>                 0x00001ecc                K_CacheInstCtrl
>                 0x00001d3c                K_CacheDataStat
>                 0x00002148                CacheDataFlushRangeSafe
>                 0x00002008                CacheDataFlushSafe
>                 0x00001dd4                K_CacheDataCtrl
> 
> Any idea why it lists the offsets out of order?  Is there an easy fix
> for this?  Anyone?  Thanks...

I've noticed this too.  I've always assumed that the linker probably
uses some kind of hashed database to maintain symbol information, and
the database is just read out in some simple database walk when printing
the mapfile.  Since I usually use vi to view the mapfile, I often pipe a
section of the mapfile through sort to order a group of symbols.  But it
would be nicer if the linker would output the symbols in address order.

Art

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: ppc map file is unordered
@ 2000-08-31  0:17 Giovanni Caterina
  0 siblings, 0 replies; 4+ messages in thread
From: Giovanni Caterina @ 2000-08-31  0:17 UTC (permalink / raw)
  To: 'Jeff Bevis', crossgcc

I had the same problem with map files generated for h8300hms target.  So I
have written a program that takes the map file as stdin and outputs to
stdout the sorted map file.
Since I was in a hurry when doing this, it's written in a "straitforward"
manner but here is it and may be it will give ideas to someone to re-write
it in a nicer manner.
I give it "as is" without any warranty that it will work with other map
files than "mines".

Hope this helps.


/*
mapsort.c
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

char Tmp[256];
char Lines[256][256];

int 
comp(const void * el1, const void * el2)
{
	return strncmp((char *)el1 + 18, (char *)el2 + 18, 8);
}

int
main(void)
{
	int LineCount, Index;
	
	while(gets(Tmp) != NULL){
		puts(Tmp);
		if(strncmp(Tmp, "Linker script", 13) == 0){
			break;
		}
	}
	LineCount = 0;
	while(gets(Tmp) != NULL){
		if(
			(strlen(Tmp) == 0)
			||
			(strncmp(Tmp, "  ", 2) != 0)
		){
			if(LineCount > 1){
				qsort(Lines, LineCount, 256, comp);
			}
			for(Index = 0; Index < LineCount;
puts(Lines[Index++]));
			puts(Tmp);
			LineCount = 0;
			continue;
		}
		if(Tmp[3] == ' '){
			strcpy(Lines[LineCount++], Tmp);
		}
	}
	return 0;
}

#########################
This message has been scanned for viruses with F-Secure Anti-Virus for
Microsoft Exchange and it has been found clean.

For more information about computer viruses, connect to
http://www.F-Secure.com/vir-info/ .
#########################

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-08-31  0:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-29 19:04 powerpc-eabi-ld (relaxing) Reini, Dave
2000-08-30  9:36 ` ppc map file is unordered Jeff Bevis
2000-08-30 10:52   ` Art Berggreen
2000-08-31  0:17 Giovanni Caterina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).