Berkeley CSUA MOTD:Entry 18572
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/24 [General] UID:1000 Activity:popular
5/24    

2000/6/30-7/1 [Computer/SW/Compilers] UID:18572 Activity:nil
6/30    anybody know where I can find documentation on linker scripts? I
        have a .link file with stuff like:
        .sbss . : {
                __bss_start = .;
                _fbss = .;
                *(.sbss) *(.scommon)
                . = ALIGN(32);
        I have no idea what these things do.  The manpages for ld doesn't
        tell me anything either.  Thanks.
        \_ <DEAD>sourceware.cygnus.com/binutils/docs-2.10/ld_3.html<DEAD>
           You should be able to find the same information by running
           "info ld", but the info pages are harder to read than HTML
           and aren't installed properly on many systems anyway.
2025/05/24 [General] UID:1000 Activity:popular
5/24    

You may also be interested in these entries...
2011/2/5-19 [Computer/SW/Languages/C_Cplusplus] UID:54027 Activity:nil
2/4     random C programming/linker fu question.  If I have
        int main() { printf("%s is at this adddr %p\n", "strlen", strlen); }
        and soda's /proc/sys/kernel/randomize_va_space is 2 (eg; on)
        why is strlen (or any other libc fn) at the same address every time?
        \_ I don't pretend to actually know the right answer to this, but
           could it have something to do with shared libraries?
	...
2005/9/9-13 [Computer/SW/OS/OsX] UID:39595 Activity:low
9/9     Does OSX gcc still not support weak symbol definitions?  ie, I
        can't redefine malloc or new? (In this case actually I'm defining
        something as weak, either with #pragma weak or
        __attribute__((weak)) but OSX doesn't seem to support either!)
        -jrleek
        \- hello, have you tried __attribute__((weak_import)). what gcc
	...
2004/9/23 [Computer/SW/OS/OsX] UID:33714 Activity:moderate
9/23    One of the grad students I work with added a piece of code to one
        of our programs that need to be dynamically linked to.  He uses a
        mac, and he only wrote the linking flags for the mac, and stuck
        that in the makefile.  So our standard linux version no longer
        works.  He then left for Rome.  How should this look in ELF?
        ifeq "$(MACOSX)" "true"
	...
2004/8/11-12 [Computer/SW/Unix] UID:32824 Activity:high
8/11    If I have two libraries libfoo.so.1 and libfoo.so.2, and I do
        something like 'cc foo.c -lfoo', is there a way to specify which
        version of libfoo the linker should link in, without having a
        libfoo.so symlink to the one I want? Thanks.
        \_ How about "cc foo.c libfoo.so.2"?
           \_ That works if I always have the full path handy, but
	...
2004/7/13 [Computer/SW/WWW/Browsers, Computer/SW/OS/FreeBSD] UID:32244 Activity:high
7/12    I just upgraded to Firefox .9 on FreeBSD 4 using a binary package,
        but it's got a ton of library dependencies on slightly older .so
        files.  Is there any way I can tell the linker to just "try your
        best" and update the links to whatever's available?  The only
        thing that's ever worked in this case is installing from ports or
        while (sane) ln -s libFoo-1.8.so.200 libFoo-1.8.so.201
	...
2004/5/9-10 [Computer/SW/Compilers] UID:30117 Activity:nil
5/9     In gcc how do you force a binary to be build even though there are
        undefined references, which you know will never be called during
        runtime? ok thx
        \_ That's normally a linker setting - for instance on Solaris, using
           native ld (not gnu ld), you'ld want the -z nodefs flag passed to
           the linker during the link phase (and probably -z lazyload so it
	...
2003/5/30-31 [Computer/SW/Compilers] UID:28580 Activity:high
5/29    There's a MIPS assembly file foo.s.  It's unoptimized.  The makefile
        compiles it into foo.o and then links with the rest of the program.
        I know there's a way to dump the actual assembly listings that is
        produced by gcc -c foo.s.  And this assembly is not the same as what's
        in foo.s because compiler optimizes it and adds in a lot more stuff
        to make it runnable.  Anybody remember how to get the assembly listings
	...
2002/8/8 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:25522 Activity:high
8/8     Why do people declare functions as "static" all the time in C?
        \_ one of the reasons is that static makes the function local
           to the file.
           to the file.  Similar to a private method in C++ or java.
           \_ So that's just a linker issue? Preventing namespace collision?
              \_ that's one of the reasons.  There are probably more, but
	...
2001/5/16-17 [Computer/SW/Compilers] UID:21286 Activity:low
5/15   anyone know how to produce a linker map file in vj++?
        \_ What exactly are you trying to do?
	...
2000/7/20-21 [Computer/SW/OS/Solaris] UID:18730 Activity:nil
7/19    Where can I find info on Solaris' dynamic shared library? For example,
        what's the technical detail on loading and method resolution,
        what's the performance loss of cross shared library call, what's
        the architectural description, etc? Thanks.
        \_ http://docs.sun.com - Linker & Libraries Guide
           "Linkers & Loaders" by John Levine
	...
2000/3/22-23 [Computer/SW/Compilers, Computer/SW/Languages/Misc] UID:17822 Activity:nil
3/21    Is there a gcc option to force labels to be outputed and to be
        included in the ELF symbol table.  I'm trying to profile this
        code:
        beginloop:
          for (i = 0; i < n; i++) {
            y[i] = a*x[i] + y[i];
	...
1998/11/10-11 [Computer/SW/Compilers] UID:14939 Activity:moderate
11/10   I'd like to implement a simple C compiler for a theoretical
        architecture (a simple one) to have test code for a simulator.
        Ideally, I'd just like to modify the backend of (say) gcc.  What is
        the simplest way to do this?  I know that gcc can output assembler,
        but can it output pseudo-code?
        \_ I would check out the book "a retargetable c compiler"
	...