mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
* target-reloc.h (relocate_section): Check whether a symbol is
defined by the ABI before reporting an undefined symbol error. * target.h (Target::is_defined_by_abi): Make parameter const. (Target::do_is_defined_by_abi): Likewise. * i386.cc (Target_i386::do_is_defined_by_abi): Likewise. * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise. * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise. * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise. * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs. * testsuite/Makefile.in: Rebuild.
This commit is contained in:
@ -1,5 +1,16 @@
|
|||||||
2008-09-16 Ian Lance Taylor <iant@google.com>
|
2008-09-16 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
|
* target-reloc.h (relocate_section): Check whether a symbol is
|
||||||
|
defined by the ABI before reporting an undefined symbol error.
|
||||||
|
* target.h (Target::is_defined_by_abi): Make parameter const.
|
||||||
|
(Target::do_is_defined_by_abi): Likewise.
|
||||||
|
* i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
|
||||||
|
* powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
|
||||||
|
* sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
|
||||||
|
* x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
|
||||||
|
* testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
|
||||||
|
* testsuite/Makefile.in: Rebuild.
|
||||||
|
|
||||||
* fileread.cc (make_view): Add casts to avoid warning.
|
* fileread.cc (make_view): Add casts to avoid warning.
|
||||||
|
|
||||||
2008-09-16 Alexandre Oliva <aoliva@redhat.com>
|
2008-09-16 Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
@ -135,7 +135,7 @@ class Target_i386 : public Sized_target<32, false>
|
|||||||
|
|
||||||
// Return whether SYM is defined by the ABI.
|
// Return whether SYM is defined by the ABI.
|
||||||
bool
|
bool
|
||||||
do_is_defined_by_abi(Symbol* sym) const
|
do_is_defined_by_abi(const Symbol* sym) const
|
||||||
{ return strcmp(sym->name(), "___tls_get_addr") == 0; }
|
{ return strcmp(sym->name(), "___tls_get_addr") == 0; }
|
||||||
|
|
||||||
// Return the size of the GOT section.
|
// Return the size of the GOT section.
|
||||||
|
@ -129,7 +129,7 @@ class Target_powerpc : public Sized_target<size, big_endian>
|
|||||||
|
|
||||||
// Return whether SYM is defined by the ABI.
|
// Return whether SYM is defined by the ABI.
|
||||||
bool
|
bool
|
||||||
do_is_defined_by_abi(Symbol* sym) const
|
do_is_defined_by_abi(const Symbol* sym) const
|
||||||
{
|
{
|
||||||
return strcmp(sym->name(), "___tls_get_addr") == 0;
|
return strcmp(sym->name(), "___tls_get_addr") == 0;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ class Target_sparc : public Sized_target<size, big_endian>
|
|||||||
section_size_type reloc_view_size);
|
section_size_type reloc_view_size);
|
||||||
// Return whether SYM is defined by the ABI.
|
// Return whether SYM is defined by the ABI.
|
||||||
bool
|
bool
|
||||||
do_is_defined_by_abi(Symbol* sym) const
|
do_is_defined_by_abi(const Symbol* sym) const
|
||||||
{
|
{
|
||||||
// XXX Really need to support this better...
|
// XXX Really need to support this better...
|
||||||
if (sym->type() == elfcpp::STT_SPARC_REGISTER)
|
if (sym->type() == elfcpp::STT_SPARC_REGISTER)
|
||||||
|
@ -283,6 +283,7 @@ relocate_section(
|
|||||||
if (sym != NULL
|
if (sym != NULL
|
||||||
&& sym->is_undefined()
|
&& sym->is_undefined()
|
||||||
&& sym->binding() != elfcpp::STB_WEAK
|
&& sym->binding() != elfcpp::STB_WEAK
|
||||||
|
&& !target->is_defined_by_abi(sym)
|
||||||
&& (!parameters->options().shared() // -shared
|
&& (!parameters->options().shared() // -shared
|
||||||
|| parameters->options().defs())) // -z defs
|
|| parameters->options().defs())) // -z defs
|
||||||
gold_undefined_symbol(sym, relinfo, i, offset);
|
gold_undefined_symbol(sym, relinfo, i, offset);
|
||||||
|
@ -164,7 +164,7 @@ class Target
|
|||||||
// Return whether SYM is known to be defined by the ABI. This is
|
// Return whether SYM is known to be defined by the ABI. This is
|
||||||
// used to avoid inappropriate warnings about undefined symbols.
|
// used to avoid inappropriate warnings about undefined symbols.
|
||||||
bool
|
bool
|
||||||
is_defined_by_abi(Symbol* sym) const
|
is_defined_by_abi(const Symbol* sym) const
|
||||||
{ return this->do_is_defined_by_abi(sym); }
|
{ return this->do_is_defined_by_abi(sym); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -222,7 +222,7 @@ class Target
|
|||||||
|
|
||||||
// Virtual function which may be implemented by the child class.
|
// Virtual function which may be implemented by the child class.
|
||||||
virtual bool
|
virtual bool
|
||||||
do_is_defined_by_abi(Symbol*) const
|
do_is_defined_by_abi(const Symbol*) const
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -468,7 +468,7 @@ tls_test_file2_pic.o: tls_test_file2.cc
|
|||||||
tls_test_c_pic.o: tls_test_c.c
|
tls_test_c_pic.o: tls_test_c.c
|
||||||
$(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
|
$(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
|
||||||
tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
|
tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
|
||||||
$(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o
|
$(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
|
||||||
tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
|
tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
|
||||||
$(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
|
$(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
|
||||||
|
|
||||||
|
@ -2125,7 +2125,7 @@ uninstall-am: uninstall-info-am
|
|||||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_c_pic.o: tls_test_c.c
|
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_c_pic.o: tls_test_c.c
|
||||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
|
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
|
||||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
|
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
|
||||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o
|
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
|
||||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
|
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
|
||||||
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
|
@GCC_TRUE@@NATIVE_LINKER_TRUE@@TLS_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ class Target_x86_64 : public Sized_target<64, false>
|
|||||||
|
|
||||||
// Return whether SYM is defined by the ABI.
|
// Return whether SYM is defined by the ABI.
|
||||||
bool
|
bool
|
||||||
do_is_defined_by_abi(Symbol* sym) const
|
do_is_defined_by_abi(const Symbol* sym) const
|
||||||
{ return strcmp(sym->name(), "__tls_get_addr") == 0; }
|
{ return strcmp(sym->name(), "__tls_get_addr") == 0; }
|
||||||
|
|
||||||
// Return the size of the GOT section.
|
// Return the size of the GOT section.
|
||||||
|
Reference in New Issue
Block a user