tccgen: don't generate elf-symbols under nocode/NODATA
seems that symbols under nocode/NODATA should not produce
elf symbols at all, not just elf symbols with no size.
See commit 4c82b00342
5 insertions(+), 5 deletions(-)
			
			
This commit is contained in:
		
							parent
							
								
									e8adc64203
								
							
						
					
					
						commit
						c81519e1c4
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		
							
								
								
									
										10
									
								
								tccgen.c
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								tccgen.c
									
										
									
									
									
								
							| 
						 | 
					@ -509,11 +509,11 @@ ST_FUNC void put_extern_sym2(Sym *sym, int sh_num,
 | 
				
			||||||
    update_storage(sym);
 | 
					    update_storage(sym);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ST_FUNC void put_extern_sym(Sym *sym, Section *section,
 | 
					ST_FUNC void put_extern_sym(Sym *sym, Section *s, addr_t value, unsigned long size)
 | 
				
			||||||
                           addr_t value, unsigned long size)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int sh_num = section ? section->sh_num : SHN_UNDEF;
 | 
					    if (nocode_wanted && (NODATA_WANTED || (s && s == cur_text_section)))
 | 
				
			||||||
    put_extern_sym2(sym, sh_num, value, size, 1);
 | 
					        return;
 | 
				
			||||||
 | 
					    put_extern_sym2(sym, s ? s->sh_num : SHN_UNDEF, value, size, 1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* add a new relocation entry to symbol 'sym' in section 's' */
 | 
					/* add a new relocation entry to symbol 'sym' in section 's' */
 | 
				
			||||||
| 
						 | 
					@ -5333,7 +5333,7 @@ ST_FUNC void unary(void)
 | 
				
			||||||
            type.t |= VT_ARRAY;
 | 
					            type.t |= VT_ARRAY;
 | 
				
			||||||
            type.ref->c = len;
 | 
					            type.ref->c = len;
 | 
				
			||||||
            sec = rodata_section;
 | 
					            sec = rodata_section;
 | 
				
			||||||
            vpush_ref(&type, sec, sec->data_offset, NODATA_WANTED ? 0 : len);
 | 
					            vpush_ref(&type, sec, sec->data_offset, len);
 | 
				
			||||||
            if (!NODATA_WANTED)
 | 
					            if (!NODATA_WANTED)
 | 
				
			||||||
                memcpy(section_ptr_add(sec, len), funcname, len);
 | 
					                memcpy(section_ptr_add(sec, len), funcname, len);
 | 
				
			||||||
            next();
 | 
					            next();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue