This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 0/2] Define _edata, __bss_start, and _end only for executables
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 30 May 2018 14:59:38 -0700
- Subject: [PATCH 0/2] Define _edata, __bss_start, and _end only for executables
_edata, __bss_start, and _end are defined for executables. FreeBSD's
libc.so uses executable's _end to initialize curbrk. But there is no
good reason to access values of _edata, __bss_start, and _end defined
in shared libraries. We should define _edata, __bss_start, and _end
only for executables.
Since _edata, __bss_start, and _end are no longer defined in shared
libraries, it will impact addresses in linker output. Many linker
tests need adjustments. I updated x86 linker tests. I will update
other linker tests if this change is approved.
H.J. Lu (2):
ld: Define _edata, __bss_start, and _end only for executables
ld: Update tests for _edata, __bss_start, and _end changes
ld/scripttempl/elf.sc | 6 +-
ld/testsuite/ld-elf/pr23161.map | 4 ++
ld/testsuite/ld-elf/pr23161.rd | 14 ++++
ld/testsuite/ld-elf/pr23161a.c | 9 +++
ld/testsuite/ld-elf/pr23161b.c | 23 ++++++
ld/testsuite/ld-elf/pr23162.rd | 9 +--
ld/testsuite/ld-elf/shared.exp | 40 +++++++++++
ld/testsuite/ld-i386/ibt-plt-1.d | 20 +++---
ld/testsuite/ld-i386/ibt-plt-2a.d | 20 +++---
ld/testsuite/ld-i386/ibt-plt-2b.d | 20 +++---
ld/testsuite/ld-i386/ibt-plt-2c.d | 20 +++---
ld/testsuite/ld-i386/ibt-plt-2d.d | 20 +++---
ld/testsuite/ld-i386/ibt-plt-3a.d | 20 +++---
ld/testsuite/ld-i386/ibt-plt-3b.d | 20 +++---
ld/testsuite/ld-i386/ibt-plt-3c.d | 20 +++---
ld/testsuite/ld-i386/ibt-plt-3d.d | 20 +++---
ld/testsuite/ld-i386/plt2.dd | 26 +++----
ld/testsuite/ld-i386/pr20830.d | 18 ++---
ld/testsuite/ld-i386/tlsbin-nacl.rd | 3 -
ld/testsuite/ld-i386/tlsbin.rd | 3 -
ld/testsuite/ld-i386/tlsbin2-nacl.rd | 3 -
ld/testsuite/ld-i386/tlsbin2.rd | 3 -
ld/testsuite/ld-i386/tlsbindesc-nacl.rd | 9 +--
ld/testsuite/ld-i386/tlsbindesc.rd | 9 +--
ld/testsuite/ld-i386/tlsdesc-nacl.rd | 6 --
ld/testsuite/ld-i386/tlsdesc.rd | 6 --
ld/testsuite/ld-i386/tlsgdesc-nacl.rd | 6 --
ld/testsuite/ld-i386/tlsgdesc.rd | 6 --
ld/testsuite/ld-i386/tlsnopic-nacl.rd | 14 ++--
ld/testsuite/ld-i386/tlsnopic.dd | 12 ++--
ld/testsuite/ld-i386/tlsnopic.rd | 6 --
ld/testsuite/ld-i386/tlsnopic.sd | 4 +-
ld/testsuite/ld-i386/tlspic-nacl.rd | 6 --
ld/testsuite/ld-i386/tlspic.rd | 6 --
ld/testsuite/ld-i386/tlspic2-nacl.rd | 6 --
ld/testsuite/ld-i386/tlspic2.rd | 6 --
ld/testsuite/ld-ifunc/ifunc-2-i386-now.d | 14 ++--
.../ld-ifunc/ifunc-2-local-i386-now.d | 14 ++--
.../ld-ifunc/ifunc-2-local-x86-64-now.d | 20 +++---
ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d | 4 +-
ld/testsuite/ld-ifunc/ifunc-2-x86-64-now.d | 20 +++---
ld/testsuite/ld-ifunc/ifunc-2-x86-64.d | 4 +-
ld/testsuite/ld-ifunc/pr17154-i386-now.d | 34 ++++-----
ld/testsuite/ld-ifunc/pr17154-i386.d | 34 ++++-----
ld/testsuite/ld-ifunc/pr17154-x86-64-now.d | 46 ++++++------
ld/testsuite/ld-ifunc/pr17154-x86-64.d | 64 ++++++++---------
ld/testsuite/ld-x86-64/bnd-branch-1-now.d | 44 ++++++------
ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d | 18 ++---
ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d | 46 ++++++------
ld/testsuite/ld-x86-64/bnd-ifunc-2.d | 46 ++++++------
ld/testsuite/ld-x86-64/bnd-plt-1-now.d | 44 ++++++------
ld/testsuite/ld-x86-64/bnd-plt-1.d | 44 ++++++------
ld/testsuite/ld-x86-64/ibt-plt-1-x32.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-1.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-2a.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-2b-x32.d | 14 ++--
ld/testsuite/ld-x86-64/ibt-plt-2b.d | 14 ++--
ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-2c.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d | 14 ++--
ld/testsuite/ld-x86-64/ibt-plt-2d.d | 15 ++--
ld/testsuite/ld-x86-64/ibt-plt-3a-x32.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-3a.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-3b-x32.d | 14 ++--
ld/testsuite/ld-x86-64/ibt-plt-3b.d | 14 ++--
ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-3c.d | 24 +++----
ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d | 14 ++--
ld/testsuite/ld-x86-64/ibt-plt-3d.d | 14 ++--
ld/testsuite/ld-x86-64/ilp32-4-nacl.d | 16 ++---
ld/testsuite/ld-x86-64/ilp32-4.d | 8 +--
ld/testsuite/ld-x86-64/load1c-nacl.d | 72 +++++++++----------
ld/testsuite/ld-x86-64/load1c.d | 72 +++++++++----------
ld/testsuite/ld-x86-64/load1d-nacl.d | 72 +++++++++----------
ld/testsuite/ld-x86-64/load1d.d | 72 +++++++++----------
ld/testsuite/ld-x86-64/mpx3n.dd | 18 ++---
ld/testsuite/ld-x86-64/mpx4.dd | 26 +++----
ld/testsuite/ld-x86-64/mpx4n.dd | 16 ++---
ld/testsuite/ld-x86-64/plt2.dd | 26 +++----
ld/testsuite/ld-x86-64/pr14207.d | 4 +-
ld/testsuite/ld-x86-64/pr19162.d | 2 +-
ld/testsuite/ld-x86-64/pr20253-1f.d | 18 ++---
ld/testsuite/ld-x86-64/pr20253-1l.d | 18 ++---
ld/testsuite/ld-x86-64/pr20830a-now.d | 26 +++----
ld/testsuite/ld-x86-64/pr20830a.d | 26 +++----
ld/testsuite/ld-x86-64/pr20830b-now.d | 26 +++----
ld/testsuite/ld-x86-64/pr20830b.d | 26 +++----
ld/testsuite/ld-x86-64/pr21038a-now.d | 26 +++----
ld/testsuite/ld-x86-64/pr21038a.d | 26 +++----
ld/testsuite/ld-x86-64/pr21038b-now.d | 26 +++----
ld/testsuite/ld-x86-64/pr21038b.d | 26 +++----
ld/testsuite/ld-x86-64/pr21038c-now.d | 36 +++++-----
ld/testsuite/ld-x86-64/pr21038c.d | 36 +++++-----
ld/testsuite/ld-x86-64/tlsbin-nacl.rd | 21 +++---
ld/testsuite/ld-x86-64/tlsbin.rd | 3 -
ld/testsuite/ld-x86-64/tlsbin2-nacl.rd | 21 +++---
ld/testsuite/ld-x86-64/tlsbin2.rd | 3 -
ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd | 33 ++++-----
ld/testsuite/ld-x86-64/tlsbindesc.rd | 7 +-
ld/testsuite/ld-x86-64/tlsdesc-nacl.rd | 54 +++++++-------
ld/testsuite/ld-x86-64/tlsdesc.rd | 10 +--
ld/testsuite/ld-x86-64/tlsgdesc-nacl.rd | 14 ++--
ld/testsuite/ld-x86-64/tlsgdesc.rd | 14 ++--
ld/testsuite/ld-x86-64/tlspic-nacl.rd | 24 +++----
ld/testsuite/ld-x86-64/tlspic.rd | 6 --
ld/testsuite/ld-x86-64/tlspic2-nacl.rd | 24 +++----
ld/testsuite/ld-x86-64/tlspic2.rd | 6 --
108 files changed, 1096 insertions(+), 1156 deletions(-)
create mode 100644 ld/testsuite/ld-elf/pr23161.map
create mode 100644 ld/testsuite/ld-elf/pr23161.rd
create mode 100644 ld/testsuite/ld-elf/pr23161a.c
create mode 100644 ld/testsuite/ld-elf/pr23161b.c
--
2.17.0