diff options
| author | Shankar Easwaran <shankare@codeaurora.org> | 2015-03-20 23:47:08 +0000 |
|---|---|---|
| committer | Shankar Easwaran <shankare@codeaurora.org> | 2015-03-20 23:47:08 +0000 |
| commit | 37d5add8a33d4b0868ace2e057a28c0e6dce3704 (patch) | |
| tree | cd62d0d8d3ce7e4cc33891cf0b5e0c04c9682b33 | |
| parent | 14726cd11b8727a569917475bbffa4b09f94148c (diff) | |
| download | bcm5719-llvm-37d5add8a33d4b0868ace2e057a28c0e6dce3704.tar.gz bcm5719-llvm-37d5add8a33d4b0868ace2e057a28c0e6dce3704.zip | |
[ELF] GLOBAL_OFFSET_TABLE is a hidden symbol
llvm-svn: 232868
| -rw-r--r-- | lld/lib/ReaderWriter/ELF/Atoms.h | 2 | ||||
| -rw-r--r-- | lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h | 2 | ||||
| -rw-r--r-- | lld/test/elf/Mips/got16-micro.test | 26 | ||||
| -rw-r--r-- | lld/test/elf/Mips/got16.test | 24 | ||||
| -rw-r--r-- | lld/test/elf/initfini-options.test-2.test | 8 | ||||
| -rw-r--r-- | lld/test/elf/initfini-options.test-3.test | 8 |
6 files changed, 35 insertions, 35 deletions
diff --git a/lld/lib/ReaderWriter/ELF/Atoms.h b/lld/lib/ReaderWriter/ELF/Atoms.h index 047f98c74aa..6a506d21d93 100644 --- a/lld/lib/ReaderWriter/ELF/Atoms.h +++ b/lld/lib/ReaderWriter/ELF/Atoms.h @@ -799,7 +799,7 @@ public: StringRef name() const override { return "_GLOBAL_OFFSET_TABLE_"; } - Scope scope() const override { return scopeGlobal; } + Scope scope() const override { return scopeLinkageUnit; } SectionChoice sectionChoice() const override { return sectionCustomRequired; } diff --git a/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h index 3ca4aac129b..f97514b525c 100644 --- a/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/DynamicLibraryWriter.h @@ -51,7 +51,7 @@ void DynamicLibraryWriter<ELFT>::buildDynamicSymbolTable(const File &file) { if (auto section = dyn_cast<AtomSection<ELFT>>(sec)) for (const auto &atom : section->atoms()) { const DefinedAtom *da = dyn_cast<const DefinedAtom>(atom->_atom); - if (da && (da->scope() != DefinedAtom::scopeTranslationUnit)) + if (da && (da->scope() == DefinedAtom::scopeGlobal)) this->_dynamicSymbolTable->addSymbol(atom->_atom, section->ordinal(), atom->_virtualAddr, atom); } diff --git a/lld/test/elf/Mips/got16-micro.test b/lld/test/elf/Mips/got16-micro.test index e9247e7d012..6b77613581e 100644 --- a/lld/test/elf/Mips/got16-micro.test +++ b/lld/test/elf/Mips/got16-micro.test @@ -105,21 +105,21 @@ # RAW: Disassembly of section .text: # RAW: main: -# RAW-NEXT: 164: 5c fc 18 80 lw $2, -32744($gp) -# RAW-NEXT: 168: 42 30 40 10 addiu $2, $2, 4160 -# RAW-NEXT: 16c: 5c fc 1c 80 lw $2, -32740($gp) -# RAW-NEXT: 170: 42 30 60 20 addiu $2, $2, 8288 -# RAW-NEXT: 174: 5c fc 20 80 lw $2, -32736($gp) -# RAW-NEXT: 178: 5c fc 24 80 lw $2, -32732($gp) -# RAW-NEXT: 17c: 5c fc 28 80 lw $2, -32728($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 5c fc 18 80 lw $2, -32744($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 42 30 40 10 addiu $2, $2, 4160 +# RAW-NEXT: {{[0x0-9a-f]+}}: 5c fc 1c 80 lw $2, -32740($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 42 30 60 20 addiu $2, $2, 8288 +# RAW-NEXT: {{[0x0-9a-f]+}}: 5c fc 20 80 lw $2, -32736($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 5c fc 24 80 lw $2, -32732($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 5c fc 28 80 lw $2, -32728($gp) # RAW: SYMBOL TABLE: -# RAW: 00000000 *UND* 00000000 -# RAW: 00001040 l .data 00000000 data_1 -# RAW: 00002060 l .data 00000001 data_2 -# RAW: 00000160 g F .text 00000004 bar -# RAW: 00000164 g F .text 0000001c main -# RAW: 00002061 g .data 00000001 data_h +# RAW: {{[0x0-9a-f]+}} *UND* 00000000 +# RAW: {{[0x0-9a-f]+}} l .data 00000000 data_1 +# RAW: {{[0x0-9a-f]+}} l .data 00000001 data_2 +# RAW: {{[0x0-9a-f]+}} g F .text 00000004 bar +# RAW: {{[0x0-9a-f]+}} g F .text 0000001c main +# RAW: {{[0x0-9a-f]+}} g .data 00000001 data_h .data .type data_1, @object diff --git a/lld/test/elf/Mips/got16.test b/lld/test/elf/Mips/got16.test index 60a17edff14..9090d3003c1 100644 --- a/lld/test/elf/Mips/got16.test +++ b/lld/test/elf/Mips/got16.test @@ -105,20 +105,20 @@ # RAW: Disassembly of section .text: # RAW: glob: -# RAW-NEXT: 12c: 18 80 84 8f lw $4, -32744($gp) -# RAW-NEXT: 130: 00 20 84 24 addiu $4, $4, 8192 -# RAW-NEXT: 134: 1c 80 84 8f lw $4, -32740($gp) -# RAW-NEXT: 138: 00 22 84 24 addiu $4, $4, 8704 -# RAW-NEXT: 13c: 20 80 84 8f lw $4, -32736($gp) -# RAW-NEXT: 140: 24 80 84 8f lw $4, -32732($gp) -# RAW-NEXT: 144: 28 80 84 8f lw $4, -32728($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 18 80 84 8f lw $4, -32744($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 00 20 84 24 addiu $4, $4, 8192 +# RAW-NEXT: {{[0x0-9a-f]+}}: 1c 80 84 8f lw $4, -32740($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 00 22 84 24 addiu $4, $4, 8704 +# RAW-NEXT: {{[0x0-9a-f]+}}: 20 80 84 8f lw $4, -32736($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 24 80 84 8f lw $4, -32732($gp) +# RAW-NEXT: {{[0x0-9a-f]+}}: 28 80 84 8f lw $4, -32728($gp) # RAW: SYMBOL TABLE: -# RAW: 00000000 *UND* 00000000 -# RAW: 00002000 l .data 00000000 str1 -# RAW: 00012200 l .data 00000005 str2 -# RAW: 0000012c g F .text 0000001c glob -# RAW: 00012205 g .data 00000004 hidden +# RAW: {{[0x0-9a-f]+}} *UND* 00000000 +# RAW: {{[0x0-9a-f]+}} l .data 00000000 str1 +# RAW: {{[0x0-9a-f]+}} l .data 00000005 str2 +# RAW: {{[0x0-9a-f]+}} g F .text 0000001c glob +# RAW: {{[0x0-9a-f]+}} g .data 00000004 hidden --- FileHeader: diff --git a/lld/test/elf/initfini-options.test-2.test b/lld/test/elf/initfini-options.test-2.test index d4f79e9d062..4742084c513 100644 --- a/lld/test/elf/initfini-options.test-2.test +++ b/lld/test/elf/initfini-options.test-2.test @@ -6,12 +6,12 @@ # RUN: llvm-readobj -symbols -dynamic-table %t.so | FileCheck %s # CHECK: Name: _init (8) -# CHECK-NEXT: Value: 0x4001E4 +# CHECK-NEXT: Value: {{[0x0-9a-f]+}} # CHECK: Name: _fini (14) -# CHECK-NEXT: Value: 0x4001EB +# CHECK-NEXT: Value: {{[0x0-9a-f]+}} # -# CHECK: 0x000000000000000C INIT 0x4001E4 -# CHECK: 0x000000000000000D FINI 0x4001EB +# CHECK: 0x000000000000000C INIT {{[0x0-9a-f]+}} +# CHECK: 0x000000000000000D FINI {{[0x0-9a-f]+}} --- FileHeader: diff --git a/lld/test/elf/initfini-options.test-3.test b/lld/test/elf/initfini-options.test-3.test index 2522a3e4149..bf8b216775d 100644 --- a/lld/test/elf/initfini-options.test-3.test +++ b/lld/test/elf/initfini-options.test-3.test @@ -7,12 +7,12 @@ # RUN: llvm-readobj -symbols -dynamic-table %t.so | FileCheck %s # CHECK: Name: _start (1) -# CHECK-NEXT: Value: 0x4001FC +# CHECK-NEXT: Value: {{[0x0-9a-f]+}} # CHECK: Name: _stop (8) -# CHECK-NEXT: Value: 0x400204 +# CHECK-NEXT: Value: {{[0x0-9a-f]+}} # -# CHECK: 0x000000000000000C INIT 0x4001FC -# CHECK: 0x000000000000000D FINI 0x400204 +# CHECK: 0x000000000000000C INIT {{[0x0-9a-f]+}} +# CHECK: 0x000000000000000D FINI {{[0x0-9a-f]+}} --- FileHeader: |

