SourceForge has been redesigned. Learn more.
Close

#1259 __start/stop_section symbols have wrong values

OTHER
closed
nobody
binutils (105)
out-of-date
Unknown
2013-01-29
2009-02-21
grischka
No

test case:
----------

#include <stdio.h>

#define START_STOP_SEG(name) \ __attribute__((section(#name))) char sym_##name; \ extern __start_##name[], __stop_##name[]

START_STOP_SEG(aaa);
START_STOP_SEG(bbb);
START_STOP_SEG(ccc);

#define PRINT_SEG(name) printf("%s: %p %p %p\n", \ #name, __start_##name, &sym_##name, __stop_##name)

int main (int argc, char **argv)
{
PRINT_SEG(aaa);
PRINT_SEG(bbb);
PRINT_SEG(ccc);
return 0;
}

/*
output:
aaa: 00402050 00403000 00403004
bbb: 00403004 00404000 00404004
ccc: 00404004 00405000 00405004
should be:
aaa: 00403000 00403000 00403001
bbb: 00404000 00404000 00404001
ccc: 00405000 00405000 00405001

tested with ld versions 2.17 and 2.19
*/

Discussion

  • Earnie Boyd

    Earnie Boyd - 2012-10-24
    • labels: --> binutils
    • milestone: --> Aged_issue
    • status: open --> closed-out-of-date
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-29
    • status: closed-out-of-date --> closed
    • resolution: --> out-of-date
    • category: --> Unknown
    • milestone: --> OTHER
     

Log in to post a comment.