Do not adjust PT_GNU_STACK segment
Bug: http://b/20687795 Bug: http://b/18051137 Change-Id: Ie8af3892cfbebcc0249e7981284c4ad97ff40317
This commit is contained in:
		
				
					committed by
					
						
						Dimitry Ivanov
					
				
			
			
				
	
			
			
			
						parent
						
							dc145b5106
						
					
				
				
					commit
					064a9800f3
				
			@@ -312,6 +312,13 @@ static void AdjustProgramHeaderOffsets(typename ELF::Phdr* program_headers,
 | 
				
			|||||||
  for (size_t i = 0; i < count; ++i) {
 | 
					  for (size_t i = 0; i < count; ++i) {
 | 
				
			||||||
    typename ELF::Phdr* program_header = &program_headers[i];
 | 
					    typename ELF::Phdr* program_header = &program_headers[i];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Do not adjust PT_GNU_STACK - it confuses gdb and results
 | 
				
			||||||
 | 
					    // in incorrect unwinding if the executable is stripped after
 | 
				
			||||||
 | 
					    // packing.
 | 
				
			||||||
 | 
					    if (program_header->p_type == PT_GNU_STACK) {
 | 
				
			||||||
 | 
					      continue;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (program_header->p_offset > hole_start) {
 | 
					    if (program_header->p_offset > hole_start) {
 | 
				
			||||||
      // The hole start is past this segment, so adjust offset.
 | 
					      // The hole start is past this segment, so adjust offset.
 | 
				
			||||||
      program_header->p_offset += hole_size;
 | 
					      program_header->p_offset += hole_size;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user