mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 00:32:30 +08:00
gold/
* layout.cc (Layout::make_output_section): Mark .tdata section as RELRO. * testsuite/relro_test.cc: Add a TLS variable.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2012-05-14 Cary Coutant <ccoutant@google.com>
|
||||||
|
|
||||||
|
* layout.cc (Layout::make_output_section): Mark .tdata section
|
||||||
|
as RELRO.
|
||||||
|
* testsuite/relro_test.cc: Add a TLS variable.
|
||||||
|
|
||||||
2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
|
2012-05-10 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR gold/14091
|
PR gold/14091
|
||||||
|
@ -1430,7 +1430,9 @@ Layout::make_output_section(const char* name, elfcpp::Elf_Word type,
|
|||||||
{
|
{
|
||||||
if (type == elfcpp::SHT_PROGBITS)
|
if (type == elfcpp::SHT_PROGBITS)
|
||||||
{
|
{
|
||||||
if (strcmp(name, ".data.rel.ro") == 0)
|
if ((flags & elfcpp::SHF_TLS) != 0)
|
||||||
|
is_relro = true;
|
||||||
|
else if (strcmp(name, ".data.rel.ro") == 0)
|
||||||
is_relro = true;
|
is_relro = true;
|
||||||
else if (strcmp(name, ".data.rel.ro.local") == 0)
|
else if (strcmp(name, ".data.rel.ro.local") == 0)
|
||||||
{
|
{
|
||||||
|
@ -45,6 +45,9 @@ int* const p1 __attribute__ ((aligned(64))) = &i1;
|
|||||||
// P2 is a local relro variable.
|
// P2 is a local relro variable.
|
||||||
int* const p2 __attribute__ ((aligned(64))) = &i2;
|
int* const p2 __attribute__ ((aligned(64))) = &i2;
|
||||||
|
|
||||||
|
// Add a TLS variable to make sure -z relro works correctly with TLS.
|
||||||
|
__thread int i3 = 1;
|
||||||
|
|
||||||
// Test symbol addresses.
|
// Test symbol addresses.
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -76,6 +79,7 @@ t1()
|
|||||||
assert(i1page != p2page);
|
assert(i1page != p2page);
|
||||||
assert(i2page != p1page);
|
assert(i2page != p1page);
|
||||||
assert(i2page != p2page);
|
assert(i2page != p2page);
|
||||||
|
assert(i3 == 1);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user