[PATCH] D17601: [ELF] - Define special symbols _etext and _edata

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 07:58:20 PST 2016


grimar added inline comments.

================
Comment at: test/ELF/edata-etext.s:4
@@ +3,3 @@
+# RUN: ld.lld %t.o -o %t
+# RUN: llvm-readobj -sections -symbols %t
+
----------------
rafael wrote:
> You are not running FileCheck.
That keeps my nerves healthy..
Fixed, thanks.

================
Comment at: test/ELF/edata-etext.s:79
@@ +78,3 @@
+# CHECK-NEXT:    Name: _edata
+# CHECK-NEXT:    Value: [[ADDR]]
+# CHECK-NEXT:    Size: 0
----------------
rafael wrote:
> I don't this this is correct. In this case they are the same because there is no padding before .bss.
> 
> To see the difference, add a
> 
>   .align 4
> 
> after the .bss and before the .space in this test.
> 
> Also, is .bss really special? My guess would be that _edata actually points to the end of the last non NOBITS section.
That seems to be true. I was confused by output results which showed equality to .bss address in addition to such line of gold code:

```
  {
    "_edata",			// name
    cgccpp::PT_LOAD,		// segment_type
    cgccpp::PF_W,		// segment_flags_set
    cgccpp::PF(0),		// segment_flags_clear
    0,				// value
    0,				// size
    cgccpp::STT_NOTYPE,		// type
    cgccpp::STB_GLOBAL,		// binding
    cgccpp::STV_DEFAULT,	// visibility
    0,				// nonvis
    Symbol::SEGMENT_BSS,	// offset_from_base <-------------------------------
    false			// only_if_ref
  },
```

Fixed.


http://reviews.llvm.org/D17601





More information about the llvm-commits mailing list