From 2650584ac4fd71ae4ed2b4e3da755b890ba0637c Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Tue, 26 Jan 2010 22:55:14 +0100 Subject: Recognize -Wl,-Bsymbolic Without -Bsymbolic, a symbol/function in a *.so can be overridden by a symbol/function in the main module. That is the default search order, but not supported by tcc. With -Bsymbolic, the linker tries to resolve a symbol/function in the current module first. The loader in tcc implements this search order. We do not distinguish -Bsymbolic and -Bsymbolic-function -- By by ... Detlef --- tccelf.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tccelf.c') diff --git a/tccelf.c b/tccelf.c index a5385b1..2d884d2 100644 --- a/tccelf.c +++ b/tccelf.c @@ -1575,6 +1575,10 @@ static int elf_output_file(TCCState *s1, const char *filename) put_dt(dynamic, DT_SONAME, put_elf_str(dynstr, s1->soname)); put_dt(dynamic, DT_TEXTREL, 0); } + + if (s1->symbolic) + put_dt(dynamic, DT_SYMBOLIC, 0); + /* add necessary space for other entries */ saved_dynamic_data_offset = dynamic->data_offset; dynamic->data_offset += sizeof(ElfW(Dyn)) * EXTRA_RELITEMS; -- cgit v1.3.1