summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/ELF/undef.s
Commit message (Collapse)AuthorAgeFilesLines
* [MC] Emit unused undefined symbol even if its binding is not setFangrui Song2019-11-081-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | Recommit r373168, which was reverted by r373242. This actually exposed a boringssl bug which has been fixed for more than one month. For the following two cases, we currently suppress the symbols. This patch emits them (compatible with GNU as). * `test2_a = undef`: if `undef` is otherwise unused. * `.hidden hidden`: if `hidden` is unused. This is the main point of the patch, because omitting the symbol would cause a linker semantic difference. It causes a behavior change that is not compatible with GNU as: .weakref foo1, bar1 When neither foo1 nor bar1 is used, we now emit bar1, which is arguably more consistent. Another change is that we will emit .TOC. for .TOC.@tocbase . For this directive, suppressing .TOC. can be seen as a size optimization, but we choose to drop it for simplicity and consistency.
* Revert "[MC] Emit unused undefined symbol even if its binding is not set"Nico Weber2019-09-301-22/+0
| | | | | | This reverts r373168. It caused PR43511. llvm-svn: 373242
* [MC] Emit unused undefined symbol even if its binding is not setFangrui Song2019-09-291-0/+22
| | | | | | | | | | | | | | | | | | | | | | | For the following two cases, we currently suppress the symbols. This patch emits them (compatible with GNU as). * `test2_a = undef`: if `undef` is otherwise unused. * `.hidden hidden`: if `hidden` is unused. This is the main point of the patch, because omitting the symbol would cause a linker semantic difference. It causes a behavior change that is not compatible with GNU as: .weakref foo1, bar1 When neither foo1 nor bar1 is used, we now emit bar1, which is arguably more consistent. Another change is that we will emit .TOC. for .TOC.@tocbase . For this directive, suppressing .TOC. can be seen as a size optimization, but we choose to drop it for simplicity and consistency. llvm-svn: 373168
* [llvm-readobj] Change -t to --symbols in tests. NFCFangrui Song2019-05-011-1/+1
| | | | | | | | | | -t is --symbols in llvm-readobj but --section-details (unimplemented) in readelf. The confusing option should not be used since we aim for improving compatibility. Keep just one llvm-readobj -t use case in test/tools/llvm-readobj/symbols.test llvm-svn: 359661
* Diagnose undefined temporary symbols.Rafael Espindola2015-06-251-10/+0
| | | | | | | | | | | | We already disallowed .global .Lfoo so this is reasonable. This is a small cherry pick from r240130. llvm-svn: 240681
* Revert r240302 ("Bring r240130 back.").Daniel Jasper2015-06-231-1/+11
| | | | | | | | | | | | | This causes errors like: ld: error: blah.o: requires dynamic R_X86_64_PC32 reloc against '' which may overflow at runtime; recompile with -fPIC blah.cc:function f(): error: undefined reference to '' blah.o:g(): error: undefined reference to '' I have not yet come up with an appropriate reproduction. llvm-svn: 240394
* Bring r240130 back.Rafael Espindola2015-06-221-11/+1
| | | | | | | | | | | | | | | | | | | | | | Now that pr23900 is fixed, we can bring it back with no changes. Original message: Make all temporary symbols unnamed. What this does is make all symbols that would otherwise start with a .L (or L on MachO) unnamed. Some of these symbols still show up in the symbol table, but we can just make them unnamed. In order to make sure we produce identical results when going thought assembly, all .L (not just the compiler produced ones), are now unnamed. Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to 205.57MB. llvm-svn: 240302
* Revert 240130, it caused crashes (repro in PR23900).Nico Weber2015-06-191-1/+11
| | | | llvm-svn: 240193
* Make all temporary symbols unnamed.Rafael Espindola2015-06-191-11/+1
| | | | | | | | | | | | | | | | What this does is make all symbols that would otherwise start with a .L (or L on MachO) unnamed. Some of these symbols still show up in the symbol table, but we can just make them unnamed. In order to make sure we produce identical results when going thought assembly, all .L (not just the compiler produced ones), are now unnamed. Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to 205.57MB. llvm-svn: 240130
* Omit unused section symbols from the symbol table.Rafael Espindola2015-06-041-36/+0
| | | | | | | | | | | | | | Section symbols exist as an optimization: instead of having multiple relocations point to different symbols, many of them can point to a single section symbol. When that optimization is unused, a section symbol is also unused and adds no extra information to the object file. This saves a bit of space on the object files and makes the output of llvm-objdump -t easier to read and consequently some tests get quite a bit simpler. llvm-svn: 239045
* Fix the interpretation of a 0 st_name.Rafael Espindola2015-06-031-4/+4
| | | | | | | | | | | | | | The ELF spec is very clear: ----------------------------------------------------------------------------- If the value is non-zero, it represents a string table index that gives the symbol name. Otherwise, the symbol table entry has no name. -------------------------------------------------------------------------- In particular, a st_name of 0 most certainly doesn't mean that the symbol has the same name as the section. llvm-svn: 238899
* Don't include an invalid symbol in the symbol table.Rafael Espindola2014-04-281-0/+3
| | | | | | | | | | | | The symbol table itself has no relocations, so it is not possible to represent things like a = undefined + 1 With the patch we just omit these variables. That matches the behaviour of the gnu assembler. llvm-svn: 207419
* List the entire symbol table in this test.Rafael Espindola2014-04-281-10/+66
| | | | | | | This will allow us to extend this test to show that other symbols don't show up in the symbol table. llvm-svn: 207418
* Teach llvm-readobj to print human friendly description of reserved sections.Rafael Espindola2014-03-241-1/+1
| | | | llvm-svn: 204584
* Replace coff-/elf-dump with llvm-readobjNico Rieck2013-04-121-26/+19
| | | | llvm-svn: 179361
* print st_shndx with the correct number of bits.Rafael Espindola2011-08-041-1/+1
| | | | llvm-svn: 136880
* print st_other with the correct number of bits.Rafael Espindola2011-08-041-1/+1
| | | | llvm-svn: 136877
* print st_type with the correct number of bits.Rafael Espindola2011-08-041-1/+1
| | | | llvm-svn: 136875
* Print st_bind with the correct number of bits.Rafael Espindola2011-08-041-1/+1
| | | | llvm-svn: 136874
* Another counter goes decimal.Rafael Espindola2011-08-041-8/+8
| | | | llvm-svn: 136871
* Print all 64bits for st_value and st_size. Adjust tests accordingly.Roman Divacky2010-12-201-2/+2
| | | | llvm-svn: 122263
* Be more strict on when we produce an undefined reference. In gas a file withRafael Espindola2010-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | just .type foo,@object will produce an undefined reference to foo. On the other hand, a file with just .weakref bar, foo will not. It is somewhat hard to support both in MC since both statements should create the symbols. It should be possible if we really need to by adding to the flags, but hopefully that is not necessary. With this patch we do not produce a undefined reference in any of those cases. The assembly file needs an actual use for the undefined reference to be present. This is in preparation for a patch implementing .weakref. llvm-svn: 117735
* Fixing r116753 r116756 r116777Jason W Kim2010-10-191-22/+22
| | | | | | | | | | | | | | | | | | | The failures in r116753 r116756 were caused by a python issue - Python likes to append 'L' suffix to stringified numbers if the number is larger than a machine int. Unfortunately, this causes a divergence of behavior between 32 and 64 bit python versions. I re-crafted elf-dump/common_dump to take care of these issues by: 1. always printing 0x (makes for easy sed/regex) 2. always print fixed length (exactly 2 + numBits/4 digits long) by mod ((2^numBits) - 1) 3. left-padded with '0' There is a residual common routine that is also used by macho-dump (dataToHex) , so I left the 'section_data' test values alone. llvm-svn: 116823
* Speculatively revert 116753 and 116756 to attempt to fix the bots.Eric Christopher2010-10-191-22/+22
| | | | llvm-svn: 116777
* Changed elf-dump to output hex format by default.Jason W Kim2010-10-181-22/+22
| | | | | | Also updated tests. llvm-svn: 116753
* Remove some code duplication.Rafael Espindola2010-10-141-3/+3
| | | | llvm-svn: 116484
* Tests that now pass.Rafael Espindola2010-10-051-13/+43
| | | | llvm-svn: 115622
* On elf, undefined symbols can start with .L.Rafael Espindola2010-09-281-0/+15
llvm-svn: 114958
OpenPOWER on IntegriCloud