Rafael Espindola | 2912972 | 2010-10-28 19:08:03 +0000 | [diff] [blame] | 1 | // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump | FileCheck %s |
| 2 | |
| 3 | // When doing a rename, all the checks for where the relocation should go |
| 4 | // should be performed with the original symbol. Only if we decide to relocate |
| 5 | // with the symbol we should then use the renamed one. |
| 6 | |
| 7 | // This is a regression test for a bug where we used bar5@@@zed when deciding |
| 8 | // if we should relocate with the symbol or with the section and we would then |
| 9 | // not produce a relocation with .text. |
| 10 | |
| 11 | defined1: |
| 12 | defined3: |
| 13 | .symver defined3, bar5@@@zed |
| 14 | .long defined3 |
| 15 | |
| 16 | .global defined1 |
| 17 | |
| 18 | // Section 1 is .text |
Rafael Espindola | 014180d | 2011-08-04 13:39:15 +0000 | [diff] [blame] | 19 | // CHECK: # Section 1 |
Rafael Espindola | 9974b8b | 2011-04-07 23:51:25 +0000 | [diff] [blame] | 20 | // CHECK-NEXT: (('sh_name', 0x00000006) # '.text' |
Rafael Espindola | 2912972 | 2010-10-28 19:08:03 +0000 | [diff] [blame] | 21 | // CHECK-NEXT: ('sh_type', 0x00000001) |
| 22 | // CHECK-NEXT: ('sh_flags', 0x00000006) |
| 23 | // CHECK-NEXT: ('sh_addr', 0x00000000) |
| 24 | // CHECK-NEXT: ('sh_offset', 0x00000040) |
| 25 | // CHECK-NEXT: ('sh_size', 0x00000004) |
| 26 | // CHECK-NEXT: ('sh_link', 0x00000000) |
| 27 | // CHECK-NEXT: ('sh_info', 0x00000000) |
| 28 | // CHECK-NEXT: ('sh_addralign', 0x00000004) |
| 29 | // CHECK-NEXT: ('sh_entsize', 0x00000000) |
| 30 | |
Rafael Espindola | 7c18fa8 | 2011-03-20 18:44:20 +0000 | [diff] [blame] | 31 | // The relocation uses symbol 2 |
Rafael Espindola | f7179de | 2011-08-04 14:01:03 +0000 | [diff] [blame] | 32 | // CHECK: # Relocation 0 |
Rafael Espindola | 7c18fa8 | 2011-03-20 18:44:20 +0000 | [diff] [blame] | 33 | // CHECK-NEXT: (('r_offset', 0x00000000) |
| 34 | // CHECK-NEXT: ('r_sym', 0x00000002) |
| 35 | // CHECK-NEXT: ('r_type', 0x0000000a) |
Rafael Espindola | d7c9b63 | 2011-08-04 13:00:24 +0000 | [diff] [blame] | 36 | // CHECK-NEXT: ('r_addend', 0x0000000000000000) |
Rafael Espindola | 7c18fa8 | 2011-03-20 18:44:20 +0000 | [diff] [blame] | 37 | |
Rafael Espindola | 2912972 | 2010-10-28 19:08:03 +0000 | [diff] [blame] | 38 | // Symbol 2 is section 1 |
Rafael Espindola | 65ad8dc | 2011-08-04 14:27:46 +0000 | [diff] [blame] | 39 | // CHECK: # Symbol 2 |
Rafael Espindola | 2912972 | 2010-10-28 19:08:03 +0000 | [diff] [blame] | 40 | // CHECK-NEXT: (('st_name', 0x00000000) # '' |
Rafael Espindola | d7c2783 | 2011-08-04 15:10:35 +0000 | [diff] [blame] | 41 | // CHECK-NEXT: ('st_bind', 0x0) |
Rafael Espindola | 71a8f5c | 2011-08-04 15:24:00 +0000 | [diff] [blame] | 42 | // CHECK-NEXT: ('st_type', 0x3) |
Rafael Espindola | 67ac0c0 | 2011-08-04 15:38:19 +0000 | [diff] [blame] | 43 | // CHECK-NEXT: ('st_other', 0x00) |
Rafael Espindola | 2912972 | 2010-10-28 19:08:03 +0000 | [diff] [blame] | 44 | // CHECK-NEXT: ('st_shndx', 0x00000001) |
Roman Divacky | 1ae3c16 | 2010-12-20 20:49:43 +0000 | [diff] [blame] | 45 | // CHECK-NEXT: ('st_value', 0x0000000000000000) |
| 46 | // CHECK-NEXT: ('st_size', 0x0000000000000000) |