qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu/target-i386 op.c ops_sse.h
@ 2005-04-26 20:38 Fabrice Bellard
  2005-04-27 13:25 ` Filip Navara
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Bellard @ 2005-04-26 20:38 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/cvsroot/qemu
Module name:	qemu
Branch: 	
Changes by:	Fabrice Bellard <bellard@savannah.gnu.org>	05/04/26 20:38:17

Modified files:
	target-i386    : op.c ops_sse.h 

Log message:
	removed switches in op.c (Paul Brook)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/target-i386/op.c.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/target-i386/ops_sse.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

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

* Re: [Qemu-devel] qemu/target-i386 op.c ops_sse.h
  2005-04-26 20:38 [Qemu-devel] qemu/target-i386 op.c ops_sse.h Fabrice Bellard
@ 2005-04-27 13:25 ` Filip Navara
  2005-04-27 13:50   ` Filip Navara
  0 siblings, 1 reply; 3+ messages in thread
From: Filip Navara @ 2005-04-27 13:25 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

Fabrice Bellard wrote:

>CVSROOT:	/cvsroot/qemu
>Module name:	qemu
>Branch: 	
>Changes by:	Fabrice Bellard <bellard@savannah.gnu.org>	05/04/26 20:38:17
>
>Modified files:
>	target-i386    : op.c ops_sse.h 
>
>Log message:
>	removed switches in op.c (Paul Brook)
>
>CVSWeb URLs:
>http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/target-i386/op.c.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
>http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/target-i386/ops_sse.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
>  
>
This breaks compilation on Windows... the attached patch fixes it.

- Filip

[-- Attachment #2: dyngen.c.diff --]
[-- Type: text/x-patch, Size: 3534 bytes --]

Index: dyngen.c
===================================================================
RCS file: /cvsroot/qemu/qemu/dyngen.c,v
retrieving revision 1.39
diff -u -p -r1.39 dyngen.c
--- dyngen.c	7 Apr 2005 22:20:28 -0000	1.39
+++ dyngen.c	27 Apr 2005 13:21:51 -0000
@@ -604,26 +604,6 @@ void sym_ent_name(struct external_syment
     }
 }
 
-char *name_for_dotdata(struct coff_rel *rel)
-{
-	int i;
-	struct coff_sym *sym;
-	uint32_t text_data;
-
-	text_data = *(uint32_t *)(text + rel->r_offset);
-
-	for (i = 0, sym = symtab; i < nb_syms; i++, sym++) {
-		if (sym->st_syment->e_scnum == data_shndx &&
-                    text_data >= sym->st_value &&
-                    text_data < sym->st_value + sym->st_size) {
-                    
-                    return sym->st_name;
-
-		}
-	}
-	return NULL;
-}
-
 static char *get_sym_name(EXE_SYM *sym)
 {
     return sym->st_name;
@@ -633,8 +613,8 @@ static char *get_rel_sym_name(EXE_RELOC 
 {
     char *name;
     name = get_sym_name(symtab + *(uint32_t *)(rel->r_reloc->r_symndx));
-    if (!strcmp(name, ".data"))
-        name = name_for_dotdata(rel);
+    if (name[0] == '.')
+        return NULL;
     return name;
 }
 
@@ -782,20 +762,25 @@ int load_object(const char *filename)
 	}
 
 		
-    /* find text relocations, if any */
-    sec = &shdr[coff_text_shndx];
-    coff_relocs = load_data(fd, sec->s_relptr, sec->s_nreloc*RELSZ);
-    nb_relocs = sec->s_nreloc;
+    /* find relocations, if any */
+    for (j = 0, nb_relocs = 0; j < fhdr.f_nscns; j++) {
+        nb_relocs += shdr[j].s_nreloc;
+    }
+    relocs = malloc(sizeof(struct coff_rel) * nb_relocs);
 
     /* set coff relocation */
-    relocs = malloc(sizeof(struct coff_rel) * nb_relocs);
-    for (i = 0, ext_rel = coff_relocs, rel = relocs; i < nb_relocs; 
-         i++, ext_rel++, rel++) {
-        memset(rel, 0, sizeof(*rel));
-        rel->r_reloc = ext_rel;
-        rel->r_offset = *(uint32_t *)ext_rel->r_vaddr;
-        rel->r_type = *(uint16_t *)ext_rel->r_type;
+    for (j = 0, rel = relocs; j < fhdr.f_nscns; j++) {
+        sec = &shdr[j];
+        coff_relocs = load_data(fd, sec->s_relptr, sec->s_nreloc*RELSZ);
+        for (i = 0, ext_rel = coff_relocs; i < sec->s_nreloc; 
+             i++, ext_rel++, rel++) {
+            memset(rel, 0, sizeof(*rel));
+            rel->r_reloc = ext_rel;
+            rel->r_offset = *(uint32_t *)ext_rel->r_vaddr;
+            rel->r_type = *(uint16_t *)ext_rel->r_type;
+        }
     }
+
     return 0;
 }
 
@@ -1303,6 +1288,8 @@ int arm_emit_ldr_info(const char *name, 
                     for(i = 0, rel = relocs;i < nb_relocs; i++, rel++) {
                         if (rel->r_offset == (pc_offset + start_offset)) {
                             sym_name = get_rel_sym_name(rel);
+                            if (!sym_name)
+                                continue;
                             /* the compiler leave some unnecessary references to the code */
                             get_reloc_expr(relname, sizeof(relname), sym_name);
                             type = ELF32_R_TYPE(rel->r_info);
@@ -1698,6 +1685,8 @@ void gen_code(const char *name, host_ulo
                 if (rel->r_offset >= start_offset &&
 		    rel->r_offset < start_offset + copy_size) {
                     sym_name = get_rel_sym_name(rel);
+                    if (!sym_name)
+                        continue;
                     if (strstart(sym_name, "__op_jmp", &p)) {
                         int n;
                         n = strtol(p, NULL, 10);

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

* Re: [Qemu-devel] qemu/target-i386 op.c ops_sse.h
  2005-04-27 13:25 ` Filip Navara
@ 2005-04-27 13:50   ` Filip Navara
  0 siblings, 0 replies; 3+ messages in thread
From: Filip Navara @ 2005-04-27 13:50 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

Filip Navara wrote:

> Fabrice Bellard wrote:
>
>> CVSROOT:    /cvsroot/qemu
>> Module name:    qemu
>> Branch:    
>> Changes by:    Fabrice Bellard <bellard@savannah.gnu.org>    05/04/26 
>> 20:38:17
>>
>> Modified files:
>>     target-i386    : op.c ops_sse.h
>> Log message:
>>     removed switches in op.c (Paul Brook)
>>
>> CVSWeb URLs:
>> http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/target-i386/op.c.diff?tr1=1.36&tr2=1.37&r1=text&r2=text 
>>
>> http://savannah.gnu.org/cgi-bin/viewcvs/qemu/qemu/target-i386/ops_sse.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text 
>>
>>  
>>
> This breaks compilation on Windows... the attached patch fixes it.

And this time with the correct patch...

- Filip

[-- Attachment #2: dyngen.c.diff --]
[-- Type: text/x-patch, Size: 976 bytes --]

Index: dyngen.c
===================================================================
RCS file: /cvsroot/qemu/qemu/dyngen.c,v
retrieving revision 1.39
diff -u -p -r1.39 dyngen.c
--- dyngen.c	7 Apr 2005 22:20:28 -0000	1.39
+++ dyngen.c	27 Apr 2005 13:40:23 -0000
@@ -635,6 +635,8 @@ static char *get_rel_sym_name(EXE_RELOC 
     name = get_sym_name(symtab + *(uint32_t *)(rel->r_reloc->r_symndx));
     if (!strcmp(name, ".data"))
         name = name_for_dotdata(rel);
+    if (name[0] == '.')
+        return NULL;
     return name;
 }
 
@@ -1698,6 +1700,8 @@ void gen_code(const char *name, host_ulo
                 if (rel->r_offset >= start_offset &&
 		    rel->r_offset < start_offset + copy_size) {
                     sym_name = get_rel_sym_name(rel);
+                    if (!sym_name)
+                        continue;
                     if (strstart(sym_name, "__op_jmp", &p)) {
                         int n;
                         n = strtol(p, NULL, 10);

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

end of thread, other threads:[~2005-04-27 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-26 20:38 [Qemu-devel] qemu/target-i386 op.c ops_sse.h Fabrice Bellard
2005-04-27 13:25 ` Filip Navara
2005-04-27 13:50   ` Filip Navara

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 NNTP newsgroup(s).