Daniel Borkmann f5e38b9284 lib: crc32: constify crc32 lookup table
Commit 8f243af42ade ("sections: fix const sections for crc32 table")
removed the compile-time generated crc32 tables from the RO sections,
because it conflicts with the definition of __cacheline_aligned which
puts all such aligned data into .data..cacheline_aligned section
optimized for wasting less space, and can cause alignment issues when
used in combination with const with some gcc versions like 4.7.0 due to
a gcc bug [1].

Given that most gcc versions should have the fix by now, we can just use
____cacheline_aligned, which only aligns the data but doesn't move it
into specific sections as opposed to __cacheline_aligned.  In case of
gcc versions having the mentioned bug, the alignment attribute will have
no effect, but the data will still be made RO.

After patch tables are in RO:

  $ nm -v lib/crc32.o | grep -1 -E "crc32c?table"
  0000000000000000 t arch_local_irq_enable
  0000000000000000 r crc32ctable_le
  0000000000000000 t crc32_exit
  --
  0000000000000960 t test_buf
  0000000000002000 r crc32table_be
  0000000000004000 r crc32table_le
  000000001d1056e5 A __crc_crc32_be

  [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52181

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-13 21:21:35 -08:00
..
2014-10-09 11:35:48 +03:00
2011-03-11 14:25:50 +00:00
2011-10-29 21:20:22 +02:00
2014-04-30 19:49:37 +01:00
2012-10-06 03:04:57 +09:00
2014-08-06 18:01:25 -07:00
2015-02-12 18:54:15 -08:00
2015-02-12 18:54:15 -08:00
2014-05-05 09:09:14 +02:00
2015-02-12 18:54:14 -08:00
2014-08-08 15:57:25 -07:00
2015-02-12 18:54:16 -08:00
2015-02-12 18:54:15 -08:00
2015-02-12 18:54:14 -08:00
2015-02-12 18:54:15 -08:00
2012-07-30 17:25:16 -07:00
2014-06-25 17:45:43 -07:00
2012-01-31 23:19:47 +02:00
2015-02-12 18:54:16 -08:00
2015-02-12 18:54:16 -08:00
2015-02-12 18:54:14 -08:00
2013-04-29 18:28:42 -07:00