Git Product home page Git Product logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
Interesting warning with slightly different repro: 

% head a.c b.c 
==> a.c <==
int CCC;
int *zoo() {
  return &CCC;
}

==> b.c <==
#include <stdio.h>
extern int CCC;
extern int *zoo();
int main(int argc, char** argv) {
  printf("main %p\n", &CCC);
  printf("lib  %p\n", zoo());
}
% ./my_clang -O2 a.c -fasan -c -fPIC && gcc -shared a.o -o a.so && gcc -c b.c 
&& ./my_clang++ -fasan -O2  b.o a.so -Wl,-rpath=. && ./a.out
./a.out: Symbol `CCC' causes overflow in R_X86_64_PC32 relocation
main 0x2829c40
lib  0x7fd102829c40

Original comment by [email protected] on 6 Oct 2011 at 3:49

from address-sanitizer.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
GNU ld gives even more interesting warning: 
/usr/bin/ld: a.o: relocation R_X86_64_PC32 against symbol `CCC' can not be used 
when making a shared object; recompile with -fPIC

/usr/bin/ld: final link failed: Bad value

Original comment by [email protected] on 6 Oct 2011 at 7:53

from address-sanitizer.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
GNU ld gives even more interesting warning: 
/usr/bin/ld: a.o: relocation R_X86_64_PC32 against symbol `CCC' can not be used 
when making a shared object; recompile with -fPIC

/usr/bin/ld: final link failed: Bad value

Original comment by [email protected] on 6 Oct 2011 at 8:09

from address-sanitizer.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 26, 2024
fixed by r849. 
This was caused by http://llvm.org/bugs/show_bug.cgi?id=11081
The fix is to not use GLobalAlias at all (we don't seem to need it anyway)

Original comment by [email protected] on 6 Oct 2011 at 10:00

  • Changed state: Fixed

from address-sanitizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.